Skip to content

Add type forwards to public Abstractions types#4067

Open
cheenamalhotra wants to merge 2 commits intomainfrom
dev/cheena/sqlauthmethod
Open

Add type forwards to public Abstractions types#4067
cheenamalhotra wants to merge 2 commits intomainfrom
dev/cheena/sqlauthmethod

Conversation

@cheenamalhotra
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 16:18
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 19, 2026
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

Adds type forwarding metadata so key authentication-related types that were moved into the Microsoft.Data.SqlClient.Extensions.Abstractions assembly remain discoverable via the Microsoft.Data.SqlClient assembly, preserving backward-compat loading behavior.

Changes:

  • Introduces TypeForwards.Abstractions.cs with TypeForwardedTo attributes for Abstractions authentication types.
  • Adds a FunctionalTests regression test that loads the moved types via the SqlClient assembly.
  • Wires the new type-forward file into legacy netfx/netcore source projects and both netfx/netcore ref-assembly projects.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/FunctionalTests/TypeForwardTests.cs Adds a functional regression test for loading Abstractions-moved types via Microsoft.Data.SqlClient assembly.
src/Microsoft.Data.SqlClient/src/TypeForwards.Abstractions.cs Adds assembly-level type-forward declarations for Abstractions authentication types.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Includes the new type-forward file in the legacy netfx build inputs.
src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj Includes the new type-forward file in the netfx reference assembly build.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Includes the new type-forward file in the legacy netcore build inputs.
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj Includes the new type-forward file in the netcore reference assembly build.

You can also share your feedback on Copilot code review. Take the survey.

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.

Looks good, with one comment, and I agree with Copilot's comments.

What scenario is this addressing? Do we support someone dropping our new DLLs into their existing app deployment and expecting things to work?

@github-project-automation github-project-automation bot moved this from To triage to In progress in SqlClient Board Mar 19, 2026
@paulmedynski paulmedynski self-assigned this Mar 19, 2026
@cheenamalhotra
Copy link
Member Author

What scenario is this addressing? Do we support someone dropping our new DLLs into their existing app deployment and expecting things to work?

Yes, this is for backwards compatibility in applications that load types by assembly reference.

@cheenamalhotra cheenamalhotra added this to the 7.0.1 milestone Mar 19, 2026
@cheenamalhotra cheenamalhotra marked this pull request as ready for review March 19, 2026 20:52
@cheenamalhotra cheenamalhotra requested a review from a team as a code owner March 19, 2026 20:52
Copilot AI review requested due to automatic review settings March 19, 2026 20:52
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 adds CLR type-forwards in Microsoft.Data.SqlClient for types that have moved into the Microsoft.Data.SqlClient.Extensions.Abstractions assembly, preserving backward compatibility for consumers that load these types from the original SqlClient assembly.

Changes:

  • Add TypeForwardedTo attributes for the public Abstractions authentication types.
  • Wire the new type-forward source file into netfx/netcore source + reference assembly builds.
  • Add a unit test ensuring the forwarded types still load via Microsoft.Data.SqlClient and resolve to the Abstractions assembly.

Reviewed changes

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

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/UnitTests/TypeForwardTests.cs Adds a regression test validating forwarding resolves to the Abstractions assembly.
src/Microsoft.Data.SqlClient/src/TypeForwards.Abstractions.cs Introduces assembly-level type-forward declarations for Abstractions types.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Includes the new type-forward source in the netfx build.
src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj Includes the type-forward source in the netfx reference assembly build.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Includes the new type-forward source in the netcore build.
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj Includes the type-forward source in the netcore reference assembly build.

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.63%. Comparing base (ce38e64) to head (1489e2c).
⚠️ Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (ce38e64) and HEAD (1489e2c). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (ce38e64) HEAD (1489e2c)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4067      +/-   ##
==========================================
- Coverage   75.09%   65.63%   -9.46%     
==========================================
  Files         280      275       -5     
  Lines       43830    65825   +21995     
==========================================
+ Hits        32914    43207   +10293     
- Misses      10916    22618   +11702     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.63% <ø> (?)

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

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Missing Type Microsoft.Data.SqlClient.SqlAuthenticationMethod - .NET Framework 4.8

3 participants