Skip to content

Commit 9004017

Browse files
committed
Add conditional text to the README and update the RIDs
1 parent 3692b6e commit 9004017

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/.template.config/template.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,23 @@
8686
},
8787
"continueOnError": true
8888
}
89-
]
89+
],
90+
"SpecialCustomOperations": {
91+
"**/*.md": {
92+
"operations": [
93+
{
94+
"type": "conditional",
95+
"configuration": {
96+
"if": [ "#### ---#if" ],
97+
"else": [ "#### ---#else" ],
98+
"elseif": [ "#### ---#elseif", "#### ---#elif" ],
99+
"endif": [ "#### ---#endif" ],
100+
"trim": "true",
101+
"wholeLine": "true",
102+
"evaluator": "C++"
103+
}
104+
}
105+
]
106+
}
107+
}
90108
}

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/McpServer-CSharp.csproj.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">net9.0</TargetFramework>
55
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
66
<!--#if (SelfContained || NativeAot)-->
7-
<RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64</RuntimeIdentifiers>
7+
<RuntimeIdentifiers>win-x64;win-arm64;osx-arm64;linux-x64;linux-arm64;linux-musl-x64</RuntimeIdentifiers>
88
<!--#else-->
99
<RollForward>Major</RollForward>
1010
<!--#endif -->

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/McpServer/McpServer-CSharp/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# MCP Server
22

3-
This README was created using the C# MCP server project template. It demonstrates how you can easily create an MCP server using C# and publish it as a NuGet package.
3+
This README was created using the C# MCP server project template.
4+
It demonstrates how you can easily create an MCP server using C# and publish it as a NuGet package.
5+
6+
#### ---#if (SelfContained)
7+
The MCP server is built as a self-contained application and does not require the .NET runtime to be installed on the target machine.
8+
However, since it is self-contained, it must be built for each target platform separately.
9+
By default, the template is configured to build for:
10+
* `win-x64`
11+
* `win-arm64`
12+
* `osx-arm64`
13+
* `linux-x64`
14+
* `linux-arm64`
15+
* `linux-musl-x64`
16+
17+
If your users have require more platforms to be supported, update the list of runtime identifiers in the project's `<RuntimeIdentifers />` element.
18+
#### ---#else
19+
The MCP server is built as a framework-dependent application and requires the .NET runtime to be installed on the target machine.
20+
The application is configured to roll-forward to the next highest major version of the runtime if one is available on the target machine.
21+
If an applicable .NET runtime is not available, the MCP server will not start.
22+
Consider building the MCP server as a self-contained application if you want to avoid this dependency.
23+
#### ---#endif
424

525
See [aka.ms/nuget/mcp/guide](https://aka.ms/nuget/mcp/guide) for the full guide.
626

0 commit comments

Comments
 (0)