Description
Describe the bug
dotnet new install
won't install a published unlisted template from nuget.org.
The scenario here is staging a package on nuget ready for release. Often there are multiple pieces to have ready at the same time so having them published to nuget but unlisted until you're ready to have available everything all at once (blog post, twitter post etc) is useful.
Using unlisted package versions is supported for regular package use (PackageReference in project), so I would expect it to be supported for package installation too.
To Reproduce
Publish a Template package to nuget.org and unlist it. Once the publishing is completed, run dotnet new install TemplatePackageName::version
to explicitly install the unlisted version.
Exceptions (if any)
The following error is displayed on the console:
The following template packages will be installed:
TemplatePackageName::version
Warning: TemplatePackageName::version is not found in NuGet feeds https://api.nuget.org/v3/index.json.
TemplatePackageName::version could not be installed, the package does not exist.
For details on the exit code, refer to https://aka.ms/templating-exit-codes#103
Further technical details
- Include the output of
dotnet --info
Output from `dotnet --info`
>dotnet --info
.NET SDK:
Version: 9.0.100-preview.7.24407.12
Commit: d672b8a045
Workload version: 9.0.100-manifests.baed1e37
MSBuild version: 17.12.0-preview-24374-02+48e81c6f1
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-preview.7.24407.12\
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[aspire]
Installation Source: VS 17.12.35209.166, VS 17.11.35208.52
Manifest Version: 8.1.0/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.1.0\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: VS 17.11.35208.52
Manifest Version: 9.0.0-preview.7.24407.4/9.0.100-preview.7
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.7\microsoft.net.sdk.maui\9.0.0-preview.7.24407.4\WorkloadManifest.json
Install Type: Msi
[android]
Installation Source: VS 17.11.35208.52
Manifest Version: 35.0.0-preview.7.41/9.0.100-preview.7
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.7\microsoft.net.sdk.android\35.0.0-preview.7.41\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: VS 17.11.35208.52
Manifest Version: 17.5.9231-net9-p7/9.0.100-preview.7
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.7\microsoft.net.sdk.maccatalyst\17.5.9231-net9-p7\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 17.11.35208.52
Manifest Version: 17.5.9231-net9-p7/9.0.100-preview.7
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.7\microsoft.net.sdk.ios\17.5.9231-net9-p7\WorkloadManifest.json
Install Type: Msi
Host:
Version: 9.0.0-preview.7.24405.7
Architecture: x64
Commit: static
.NET SDKs installed:
6.0.321 [C:\Program Files\dotnet\sdk]
6.0.425 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.108 [C:\Program Files\dotnet\sdk]
8.0.400 [C:\Program Files\dotnet\sdk]
9.0.100-preview.7.24407.12 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-preview.7.24405.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Executed at command line