-
Notifications
You must be signed in to change notification settings - Fork 831
Target .NET 8 for more stable runtime requirement #6617
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 updates the MCP server templates to require .NET 8 or newer at runtime and bumps the hosting package preview version.
- Changed C# templates and snapshots to target
net8.0
and added aRollForward
policy. - Updated
GeneratedContent.targets
to useMicrosoft.Extensions.Hosting
preview 6. - Refreshed integration test snapshots to match the new template outputs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/mcpserver.Basic.verified/mcpserver/mcpserver.csproj | Updated target framework to net8.0 and added <RollForward>LatestMajor</RollForward> in the snapshot |
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in | Changed TargetFramework to net8.0 and added <RollForward>LatestMajor</RollForward> in the C# template input |
src/ProjectTemplates/GeneratedContent.targets | Bumped <TemplatePackageVersion_MicrosoftExtensionsHosting> to 10.0.0-preview.6.25358.103 |
Comments suppressed due to low confidence (2)
src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in:5
- [nitpick] Consider adding or updating an integration test to verify that the generated runtimeconfig.json for net8.0 templates includes the RollForward setting.
<RollForward>LatestMajor</RollForward>
src/ProjectTemplates/GeneratedContent.targets:38
- [nitpick] Consider centralizing template package version definitions or using a shared MSBuild property so you only need to bump the version in one place.
<TemplatePackageVersion_MicrosoftExtensionsHosting>10.0.0-preview.6.25358.103</TemplatePackageVersion_MicrosoftExtensionsHosting>
.../Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in
Outdated
Show resolved
Hide resolved
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.
Looks good to me once the <RollForward>Major</Rollforward>
change is pushed.
Oops, push was hung. Done. |
* Target .NET 8 for more stable runtime requirement * Address comment
* Target .NET 8 for more stable runtime requirement * Address comment
* Target .NET 8 for more stable runtime requirement * Address comment
* Target .NET 8 for more stable runtime requirement * Address comment
MCP Servers built with preview .NET SDK 6 and 7 are currently stamped with a .NET 10 preview runtime requirement. This is okay for a given SDK+runtime version but is painful when the next preview or GA come out because they are different runtime versions. In other words, .NET 10 Preview 6 runtime is a different runtime version from Preview 7 and from .NET 10.0.0 (stable version, starting with RC1).
This PR also bumps to the latest version on Microsoft.Extensions.Hosting, which is compatible with .NET 8.
This PR makes it so the MCP servers are stamped with a
.NET 8 or newer (preferring .NET 8 if present)
runtime requirement.OLD
<assembly name>.runtimeconfig.json
file put in the .nupkg (problematic):NEW
<assembly name>.runtimeconfig.json
file (better):