- Notifications
You must be signed in to change notification settings - Fork311
Re-introduce .NET Standard 2.0 DLLs#3381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this 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 re-introduces .NET Standard 2.0 DLLs for both the lib and ref folders, aligning with the pattern used by the System.Data.SqlClient NuGet package.
- Updated the nuspec file to add a new targetFramework group for netstandard2.0 and adjust dependency versions.
- Modified the ref project file to include netstandard2.0 and configure proper output paths using the BuildForLib flag.
- Enhanced the build.proj file to include a BuildNetStandard target for building the .NET Standard DLLs.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
tools/specs/Microsoft.Data.SqlClient.nuspec | Added a new targetFramework group for netstandard2.0 and updated dependencies accordingly. |
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj | Expanded TargetFrameworks to include netstandard2.0 and introduced conditions for BuildForLib output paths. |
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs | Wrapped some API members with conditional compilation (#if NET) for targeted builds. |
build.proj | Added a BuildNetStandard target and updated dependencies to incorporate .NET Standard builds. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedMay 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #3381 +/- ##==========================================+ Coverage 65.07% 67.97% +2.89%========================================== Files 298 298 Lines 65515 65525 +10 ==========================================+ Hits 42634 44538 +1904+ Misses 22881 20987 -1894
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@cheenamalhotra Will we be reintroducing tests for netstandard builds? I'm concerned that since we removed a lot of code that was specific to netstandard implementation (at least in the interop space), allowing people to compile against ref binaries for netstandard will result in runtime errors. Just checking that this is something we considered. |
cheenamalhotra commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
No, because we are only adding compile time assemblies for .NET Standard, not runtime assemblies, we don't need to add changes to src projects and therefore only ref projects are built for .NET Standard target. Also, .NET Standard is not a runtime framework, it's only a target framework for libraries and reusable components that are shipped as NuGet packages. When a "runtime" framework targets them, respective runtime assemblies are fetched from dependency packages and resolved by .NET/MsBuild SDK. This is the model of how SDS NuGet package is shipped, we're using the same for MDS now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Where should we document that the NetStandard DLL isn't supported at runtime?
I would add that somewhere it's easy to find, should we consider adding to the NuGet package readme itself? |
k290 commentedJun 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
What about 2.1 which was also previously supported in Microsoft.Data.SqlClient? |
@k290 Target .NET 8.0 iso NET Standard 2.1 (earlier versions of .NET (Core) are out of support) |
There isn't any API difference in those, and 'netstandard2.0' dll will be resolved when an app targets .NET Standard 2.1. |
01f85bf
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Addresses#3316
This update brings back .NET Standard DLLs for the lib and ref folders - following the pattern fromSystem.Data.SqlClient NuGet package.
The new NuGet package folder structure shall look like: