Allow .NET 8 projects to consume the MCP SDK#1297
Draft
dagirard wants to merge 4 commits intomodelcontextprotocol:mainfrom
Draft
Allow .NET 8 projects to consume the MCP SDK#1297dagirard wants to merge 4 commits intomodelcontextprotocol:mainfrom
dagirard wants to merge 4 commits intomodelcontextprotocol:mainfrom
Conversation
Consumers running on .NET 8 runtime (including PowerShell) hit conflicts with Microsoft.Extensions.* 10.x dependencies. Condition package versions so the net8.0 build uses 8.x versions of Microsoft.Extensions.* packages while other TFMs continue using 10.x. Key changes: - Split shared product and testing M.E.* deps into net8.0/non-net8.0 groups - M.E.AI/AI.Abstractions use 9.10.2 for net8.0 (latest 9.x with 8.x transitive deps) - Add explicit System.Text.Json 10.x dep for net8.0 (no longer transitive from M.E.*) - Downgrade Serilog.Extensions.Hosting/Logging to 8.0.0 for net8.0 - Add ILogger field in StreamableHttpPostTransport for 8.x LoggerMessage generator - Conditional-compile InstrumentAdvice usage (not in net8.0 DiagnosticSource) - Exclude M.E.AI.OpenAI from net8.0 test builds (requires M.E.AI 10.x) - Move ChatWithTools sample to net9.0 (depends on M.E.AI.OpenAI) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t.Json 10.x dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix TestServer.exe path resolution by using full path instead of bare filename, which failed when cmd.exe wrapper resolved against repo root - Fix conformance test success detection to handle Node.js libuv assertion crash on Windows by checking stdout for "0 failed" as fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downgrade Microsoft.Extensions.* to 8.x for net8.0 TFM.
Motivation and Context
Large projects may not be able to uptake (yet) .NET 10 due to external dependencies.
The MCP C# SDKs requires Microsoft.Extensions* v10, and it is almost impossible to uptake those in .NET 8 projects, as they have very big cascading effect.
The only one that can be loaded in .NET 8 with custom assembly load context is System.Text.Json V10 and its dependencies. (IO.Pipelines and BCL.AsyncInterfaces)
After analyzing the MCP C# SDK, it has been determined that the .NET 8 version can consume the Microsoft.Extensions* v8 dependencies with minimal conditional changes. (See the file changed)
How Has This Been Tested?
Tested with our product, Microsoft Dynamics 365 Business Central, which successfully managed to uptake the custom version.
Breaking Changes
None.
Types of changes
Checklist
Additional context
Co-Authored with Claud Opus 4.6.