Skip to content

Conversation

@benrr101
Copy link
Contributor

Description

Introduced _WINDOWS/_UNIX compile-time constants and TargetOs selection in src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj, plus mirrored updates to netcore/src/Microsoft.Data.SqlClient.csproj and netfx/src/Microsoft.Data.SqlClient.csproj so OS-gated code can be compiled from the common project and Windows-only ILLink substitutions are conditionally embedded (Resources/ILLink.Substitutions.xml).

Normalized OS-specific sources to .windows/.unix naming and wired them into the new flags (e.g., LocalDbApi., LocalDB.netcore., PacketHandle., SessionHandle., SqlFileStream., SqlColumnEncryption, TdsParser*, SNI interop files), with new netfx-specific shims like PacketHandle.netfx.cs and SessionHandle.netfx.cs. Refactored shared helpers into OS- and target-aware partials: AdapterUtil.cs now delegates netfx- and netcore-specific pieces to AdapterUtil.netfx.cs/AdapterUtil.netcore.cs; DbConnectionPoolIdentity.cs and SqlDataSourceEnumerator.cs now pick managed vs native implementations based on _WINDOWS/_UNIX and LocalAppContextSwitches.UseManagedNetworking; added netfx-only System/Diagnostics/CodeAnalysis.netfx.cs.

Folded the netcore app–specific SSL over TDS stream logic into ManagedSni/SslOverTdsStream.netcore.cs, adding span-based sync/async read handling and packet encapsulation directly in the shared file.

Tidied LocalAppContextSwitches.cs for clearer NET vs NETFRAMEWORK behavior (globalization invariant handling and managed SNI defaults) under the new OS constants.

[The above is AI generated]

Issues

Continuation of work from #1261

Testing

Projects still build, and the common project is building too 👀

…o methods that had separate implementations were identical...
…partial.

This file is too big to come up with a consistent way to split all this stuff up.
…c class.

Cleaned up some code (removed redundant parentheses, split some long lines, removed always-false variables)
…ssionHandle.netfx. This really makes these classes easier to read.
… add comment explaining why this file exists.
Copilot AI review requested due to automatic review settings December 1, 2025 19:30
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 81 out of 83 changed files in this pull request and generated no new comments.

paulmedynski
paulmedynski previously approved these changes Dec 1, 2025
…at are platform specific in

Fix case-sensitivity issues in netfx project
paulmedynski
paulmedynski previously approved these changes Dec 2, 2025
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 83 out of 85 changed files in this pull request and generated no new comments.

mdaigle
mdaigle previously approved these changes Dec 3, 2025
@benrr101 benrr101 dismissed stale reviews from mdaigle and paulmedynski via 9927a17 December 4, 2025 16:51
…on netfx project, remove explicit NETFRAMEWORK definition in netfx b/c the sdk does it.
Copilot AI review requested due to automatic review settings December 4, 2025 19:22
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 89 out of 91 changed files in this pull request and generated no new comments.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 57.45342% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.87%. Comparing base (ec842b1) to head (37897c6).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...a/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs 48.98% 101 Missing ⚠️
...SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs 38.46% 16 Missing ⚠️
...ent/src/Microsoft/Data/Common/AdapterUtil.netfx.cs 31.81% 15 Missing ⚠️
...lClient/ConnectionPool/DbConnectionPoolIdentity.cs 91.11% 4 Missing ⚠️
...t/src/Microsoft/Data/Common/AdapterUtil.netcore.cs 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (ec842b1) and HEAD (37897c6). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (ec842b1) HEAD (37897c6)
addons 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3810       +/-   ##
===========================================
- Coverage   90.82%   69.87%   -20.95%     
===========================================
  Files           6      265      +259     
  Lines         316    66407    +66091     
===========================================
+ Hits          287    46403    +46116     
- Misses         29    20004    +19975     
Flag Coverage Δ
addons ?
netcore 69.83% <56.27%> (?)
netfx 69.33% <57.14%> (?)

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.

@benrr101 benrr101 merged commit 9bce6ad into main Dec 8, 2025
256 checks passed
@benrr101 benrr101 deleted the dev/russellben/os-flags branch December 8, 2025 23:25
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.

5 participants