Skip to content

Merge | Ref Projects#3963

Merged
mdaigle merged 24 commits intomainfrom
dev/russellben/common/ref
Feb 24, 2026
Merged

Merge | Ref Projects#3963
mdaigle merged 24 commits intomainfrom
dev/russellben/common/ref

Conversation

@benrr101
Copy link
Contributor

Description

As much as I want to remove the ref projects, they are tightly coupled to the netstandard binaries and the AnyOS "not supported" binaries. Detangling those will be a headache that we don't need to do right now. So instead, let's at least merge the ref projects into a common ref project just like we did for MDS projects.

The files were broken up differently from netcore, netfx, and netstandard, so I opted to break them down into one file per namespace. This made merging easier, and will likely make maintenance easier in the future.

No changes to the builds were made. Projects were updated to point to the merged files, and a common ref project was added. The solution file was modified slightly to make it clearer the difference between common ref project and common mds project.

This should unblock packing the common project.

Testing

Local builds of the ref projects still works, I presume they will continue to work in CI builds.

@benrr101 benrr101 added this to the 7.0.0-preview4 milestone Feb 16, 2026
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Feb 16, 2026
Copilot AI review requested due to automatic review settings February 16, 2026 19:11
@benrr101 benrr101 requested a review from a team as a code owner February 16, 2026 19:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates the various reference-assembly source files into a shared src/Microsoft.Data.SqlClient/ref/ set (organized roughly by namespace), updates the existing netcore/ref and netfx/ref projects to compile those shared files, and adjusts the solution layout to include the new common ref project—aiming to unblock packing the common project without removing ref projects.

Changes:

  • Added a new common ref project (src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj) and split ref sources into multiple shared files under src/Microsoft.Data.SqlClient/ref/.
  • Updated src/Microsoft.Data.SqlClient/netcore/ref and src/Microsoft.Data.SqlClient/netfx/ref csproj files to compile the shared ref sources from ../../ref/.
  • Updated the solution to add a ref solution folder and include the new common ref project (and re-add the common src project).

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.cs Adds ref stubs for Microsoft.Data surface (currently has namespace mismatch issues).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.Sql.cs Adds ref stubs for Microsoft.Data.Sql surface (contains an auto-property stub issue).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj New common multi-targeted ref project for shared ref sources.
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Server.cs Adds server namespace ref stubs (contains incorrect <include> pathing).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Diagnostics.cs Adds diagnostics ref stubs (contains namespace mismatch + malformed XML doc comments + auto-property stub issue).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.DataClassification.cs Adds DataClassification ref stubs.
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlTypes.cs Adds SqlTypes ref stubs (SqlJson/SqlVector/SqlFileStream).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs Removes old batch ref file (now expected to be covered by merged ref sources).
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.NetCoreApp.cs Removes netcoreapp-only batch ref file (now expected to be covered by merged ref sources).
src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj Points netfx ref project at shared ../../ref/* files (currently missing Diagnostics ref file).
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj Points netcore ref project at shared ../../ref/* files (currently missing Diagnostics ref file).
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.Manual.cs Removes old manual ref file (expected to be covered by merged ref sources).
src/Microsoft.Data.SqlClient.sln Adds a ref folder and the new common ref project; adjusts project entries (project type GUID inconsistency).

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have questions about internal/private items being declared, and a lack of access modifiers.

I'm also wondering if it's worth adding a check to the pipelines to ensure that the APIs declared in the ref project are identical to those declared in the implementation. Or perhaps a build target to catch problems pre-commit. It's critical that the APIs are identical, and we've released packages with discrepancies before.

@paulmedynski paulmedynski self-assigned this Feb 17, 2026
Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also like to find a way to more easily compare before and after. Maybe we can leverage this? https://learn.microsoft.com/en-us/dotnet/standard/assembly/inspect-contents-using-metadataloadcontext

@edwardneal
Copy link
Contributor

I think there's already tooling to compare ref assemblies to implementation assemblies - the ApiCompat packages may be useful here.

There are also other similar tools located here (although netstandard2.0 ref assemblies make GenAPI very difficult.) An earlier version of GenAPI is already in the SqlClient source tree.

Copilot AI review requested due to automatic review settings February 18, 2026 23:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 5 comments.

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be an interesting experiment to see how well the AI can be instructed to produce precisely the code that we want.

Copilot AI review requested due to automatic review settings February 19, 2026 22:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 2 comments.

@mdaigle mdaigle merged commit 9ba4ad9 into main Feb 24, 2026
294 checks passed
@mdaigle mdaigle deleted the dev/russellben/common/ref branch February 24, 2026 18:23
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (fbf872e) to head (9101645).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #3963   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Common Project 🚮 Things that relate to the common project project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants