Add net472 support for SqlCore library and update conditional compilation fixes#2635
Add net472 support for SqlCore library and update conditional compilation fixes#2635
Conversation
- Add net472 to Hosting, VSCode, and SqlCore project TargetFrameworks - Change ProtocolEndpoint.cs WaitAsync guard from NETSTANDARD2_0 to !NET6_0_OR_GREATER - Update Logger.cs to prefer Environment.ProcessId under NET6_0_OR_GREATER - Update SqlClientEventListener.cs conditionals for net472 support and OSThreadId - Guard RequiresUnreferencedCode/RequiresDynamicCode in KernelJsonSchemaBuilder.cs with NET6_0_OR_GREATER Co-authored-by: bruzel <3098798+bruzel@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/sqltoolsservice/sessions/a3da12b3-a743-44ed-ab4e-6a392721df54
There was a problem hiding this comment.
Pull request overview
Adds .NET Framework 4.7.2 (net472) as an additional target for the emerging SqlCore package and key dependent libraries, enabling compatibility with .NET Framework consumers such as SSMS. The PR also updates a few conditional compilation blocks to avoid APIs/attributes that aren’t available on net472, while keeping runtime behavior effectively unchanged.
Changes:
- Multi-target
Microsoft.SqlTools.SqlCoreandMicrosoft.SqlTools.Hostingfornet472alongside existing TFMs. - Multi-target
Microsoft.SqlTools.Connectors.VSCodefornet472and gate trimming/AOT-related attributes behindNET6_0_OR_GREATER. - Adjust framework-conditional code paths for process/thread ID logging and
Task.WaitAsyncusage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.SqlTools.SqlCore/Microsoft.SqlTools.SqlCore.csproj | Adds net472 to SqlCore target frameworks. |
| src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj | Adds net472 to Hosting target frameworks. |
| src/Microsoft.SqlTools.Hosting/Utility/SqlClientEventListener.cs | Makes EventCounter filtering and thread ID logging compile across net472 / netstandard2.0 / net8. |
| src/Microsoft.SqlTools.Hosting/Utility/Logger.cs | Uses Environment.ProcessId only on NET6_0_OR_GREATER, fallback otherwise for net472 compatibility. |
| src/Microsoft.SqlTools.Hosting/Hosting/Protocol/ProtocolEndpoint.cs | Uses Task.WaitAsync only when available (NET6_0_OR_GREATER). |
| src/Microsoft.SqlTools.Connectors.VSCode/Microsoft.SqlTools.Connectors.VSCode.csproj | Adds net472 as an additional target framework. |
| src/Microsoft.SqlTools.Connectors.VSCode/InternalUtilities/src/Schema/KernelJsonSchemaBuilder.cs | Wraps trimming/AOT attributes to avoid missing-attribute compile failures on net472. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…SchemaBuilder, ProtocolEndpoint, and Logger
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR is the first step in a multi‑PR effort to migrate schema comparison logic into a reusable
SqlCoreNuGet package, which can later be consumed by other clients (like SSMS).In this PR, we introduce .NET Framework 4.7.2 as an additional compilation target for the
SqlCorelibrary (and its dependent libraries) to enable compatibility with SSMS. This requires a small number of conditional compilation adjustments, all of which are non‑functional and do not affect runtime behavior. No additional test coverage is added in this PR, as existing tests are expected to continue working unchanged.The overall migration plan is documented here:
📄 Schema Compare Migration Plan
https://github.com/microsoft/sqltoolsservice/blob/copilot/focus-new-interfaces-service-project/docs/schema-compare-migration-plan.md
Code Changes Checklist
dotnet test)Reviewers: Please read our reviewer guidelines