-
Notifications
You must be signed in to change notification settings - Fork 658
Description
Impact
It bothers me. A fix would be nice
Describe the bug
The NuGet Gallery currently displays .NET CLI template install commands using the deprecated double-colon (::) version separator, e.g., dotnet new install ::. Modern .NET SDKs (including .NET 8) display a deprecation warning when this syntax is used, and recommend using the at-symbol (@) instead: dotnet new install @. This can cause confusion for users who copy instructions from the site.
The code that generates these commands appears to be in src/NuGetGallery/Views/Packages/DisplayPackage.cshtml.
Repro Steps
- Visit a template package details page on NuGet.org (e.g., https://www.nuget.org/packages/Microsoft.McpServer.ProjectTemplates)
- Observe the install command shown under ".NET CLI":
dotnet new install Microsoft.McpServer.ProjectTemplates::0.5.0-preview.1.25619.3 - Run this command with .NET 8+ and see a deprecation warning
- If you use @ instead (e.g., dotnet new install Microsoft.McpServer.ProjectTemplates@0.5.0-preview.1.25619.3), the deprecation warning is not shown.
Expected Behavior
The install command shown on NuGet.org should use the @ separator instead of the deprecated :: separator, e.g.
dotnet new install @
Screenshots
No response
Additional Context and logs
References:
- Deprecation implementation in dotnet/sdk: https://github.com/dotnet/sdk/blob/main/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs
- Official documentation: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new-install
- Community discussions: https://github.com/dotnet/sdk/issues?q=is%3Aissue+dotnet+new+install+at+symbol
The canonical code to update is likely here: https://github.com/NuGet/NuGetGallery/blob/main/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml