Skip to content

Backport PR #4063 to release/7.0: Add missing System.Data.Common package reference#4074

Open
Copilot wants to merge 3 commits intorelease/7.0from
copilot/backport-pr-4063-to-release-7-0
Open

Backport PR #4063 to release/7.0: Add missing System.Data.Common package reference#4074
Copilot wants to merge 3 commits intorelease/7.0from
copilot/backport-pr-4063-to-release-7-0

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

Description

Backports #4063 to the release/7.0 branch.

Adds the missing System.Data.Common (v4.3.0) NuGet package reference that was omitted from the release/7.0 branch. System.Data.Common ships as an inbox assembly on .NET Framework, but the inbox version predates newer APIs such as IDbColumnSchemaGenerator. Without this explicit NuGet dependency, consumers encounter CS0012 compilation errors when using types like IDbColumnSchemaGenerator exposed through Microsoft.Data.SqlClient's public API.

Files changed

  • Directory.Packages.props — added central package version entry for System.Data.Common v4.3.0
  • src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj — added PackageReference for System.Data.Common with explanatory XML comment
  • src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj — added PackageReference for System.Data.Common with explanatory XML comment
  • tools/specs/Microsoft.Data.SqlClient.nuspec — added System.Data.Common v4.3.0 dependency with explanatory XML comment

The XML comments in each file document why the NuGet package must be declared explicitly even though the assembly ships inbox on .NET Framework: the inbox version predates APIs such as IDbColumnSchemaGenerator, and declaring the NuGet package ensures consumers receive the updated assembly (which type-forwards to the inbox assembly when the runtime already provides a newer version) and avoid CS0012 errors.

The branch has also been merged with release/7.0 to incorporate the latest pipeline and workflow changes from that branch.

Issues

Testing

No automated tests were added or modified — this is a package reference and documentation fix only. The change ensures System.Data.Common v4.3.0 is declared as an explicit NuGet dependency for net462 consumers so that they receive the updated assembly and are not required to add a manual reference to avoid CS0012 errors.

Guidelines

Please review the contribution guidelines before submitting a pull request:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@paulmedynski
Copy link
Contributor

@copilot Please document why we are explicitly depending on the NuGet package version of System.Data.Common for .NET Framework, even though it is included with the base common libraries.

…on .NET Framework

Co-authored-by: paulmedynski <31868385+paulmedynski@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/SqlClient/sessions/a5fab7d4-0f66-4552-98b9-4635fa63c441
Copy link
Contributor Author

Copilot AI commented Mar 23, 2026

@copilot Please document why we are explicitly depending on the NuGet package version of System.Data.Common for .NET Framework, even though it is included with the base common libraries.

Added XML comments in commit 084eada to all three affected files (src/Microsoft.Data.SqlClient.csproj, netfx/ref/Microsoft.Data.SqlClient.csproj, and Microsoft.Data.SqlClient.nuspec).

The explanation: System.Data.Common ships as an inbox assembly on .NET Framework, but the inbox version predates newer APIs such as IDbColumnSchemaGenerator. The NuGet package provides these newer APIs (type-forwarding to the inbox assembly when the runtime already supplies a newer version). Without this explicit dependency, consumers encounter CS0012 errors — "The type 'IDbColumnSchemaGenerator' is defined in an assembly that is not referenced" — when using types from our public API that involve System.Data.Common types (see issue #4062).

@mdaigle mdaigle marked this pull request as ready for review March 23, 2026 18:58
@mdaigle mdaigle requested a review from a team as a code owner March 23, 2026 18:58
Copilot AI review requested due to automatic review settings March 23, 2026 18:58
@paulmedynski
Copy link
Contributor

@copilot When this PR merges, please apply the XML documentation you generated to the main branch in a new PR.

Copy link
Contributor Author

Copilot AI commented Mar 23, 2026

@copilot When this PR merges, please apply the XML documentation you generated to the main branch in a new PR.

Noted. The main branch already has System.Data.Common referenced in the same three files but without the explanatory comments. Once this PR merges, I'll open a follow-up PR targeting main to add the same XML documentation to src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj, src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj, and tools/specs/Microsoft.Data.SqlClient.nuspec.

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

Backport to release/7.0 to ensure net462 consumers get an explicit System.Data.Common NuGet dependency, preventing CS0012 compile errors when public APIs (e.g., IDbColumnSchemaGenerator) are referenced.

Changes:

  • Added central package version for System.Data.Common 4.3.0.
  • Added System.Data.Common PackageReference for the net462 build (implementation) and for the netfx reference-assembly project.
  • Added a net462-only System.Data.Common dependency to the .nuspec so the published package declares it for consumers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Directory.Packages.props Centrally pins System.Data.Common to 4.3.0.
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Adds System.Data.Common package reference for net462 build output.
src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj Adds System.Data.Common package reference so ref assembly build has the required metadata.
tools/specs/Microsoft.Data.SqlClient.nuspec Declares System.Data.Common 4.3.0 as a net462 dependency for consumers.

Copilot AI requested a review from paulmedynski March 23, 2026 19:02
@mdaigle mdaigle linked an issue Mar 23, 2026 that may be closed by this pull request
@paulmedynski paulmedynski self-assigned this Mar 24, 2026
@paulmedynski paulmedynski added this to the 7.0.1 milestone Mar 24, 2026
@paulmedynski paulmedynski added the Regression 💥 Issues that are regressions introduced from earlier PRs. label Mar 24, 2026
@priyankatiwari08 priyankatiwari08 moved this from To triage to In review in SqlClient Board Mar 24, 2026
@mdaigle
Copy link
Contributor

mdaigle commented Mar 24, 2026

@copilot bring this branch up to date with the target branch

Copy link
Contributor Author

Copilot AI commented Mar 24, 2026

@copilot bring this branch up to date with the target branch

Done — merged origin/release/7.0 (commit 10d2a55) into this branch in bbe1a41. No conflicts.

Copilot AI requested a review from mdaigle March 24, 2026 22:22
@cheenamalhotra
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/7.0@10d2a55). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff               @@
##             release/7.0    #4074   +/-   ##
==============================================
  Coverage               ?   65.70%           
==============================================
  Files                  ?      275           
  Lines                  ?    65825           
  Branches               ?        0           
==============================================
  Hits                   ?    43249           
  Misses                 ?    22576           
  Partials               ?        0           
Flag Coverage Δ
PR-SqlClient-Project 65.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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

Regression 💥 Issues that are regressions introduced from earlier PRs.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

System.Data.Common required on net classic after updating to v7

6 participants