-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
When running dotnet new <template>
, the CLI checks to see if a newer version of the template package is available. If there is a newer package that exists, but is unlisted on nuget.org, that package version is shown as being available as an update.
Furthermore, when dotnet new install <template-package-id>
is run, if the newest package version is unlisted, that is still the version that gets installed.
The same issue was previously reported and fixed for dotnet tool
updates. There were a few duplicate issues that ended up being consolidated into Unlisted packages are still installed via dotnet tool install
without --version
despite correctly not showing up in dotnet tool search
(dotnet/sdk#24037), which was fixed by dotnet tool install skip unlisted version (dotnet/sdk#28951).
To Reproduce
This was discovered with the Microsoft.Extensions.AI.Templates package. I had version 9.5.0-preview.2.25262.9 installed, and running dotnet new aichatweb
is producing the following output:
To update the package use:
dotnet new install Microsoft.Extensions.AI.Templates::9.5.0-preview.2.25265.7
Version 9.5.0-preview.2.25265.7
was published and immediately unlisted yesterday, so I didn't expect dotnet new
to recommend an update to it.
After running dotnet new uninstall Microsoft.Extensions.AI.Templates
, I then ran dotnet new install Microsoft.Extensions.AI.Templates
, and that unlisted package version was installed.
I am about to publish a newer version of the template package that will be listed, so this issue will stop reproducing today and another repro scenario will need to be set up to address this issue.
Further technical details
❯ dotnet --info
.NET SDK:
Version: 10.0.100-preview.2.25108.4
Commit: c0f88f2416
Workload version: 10.0.100-manifests.66aac052
MSBuild version: 17.14.0-preview-25107-06+a51113d69
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-preview.2.25108.4\
.NET workloads installed:
[aspire]
Installation Source: VS 17.14.36017.23, VS 17.14.36109.1
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 17.14.36109.1
Manifest Version: 18.4.9288/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.4.9288\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: VS 17.14.36109.1
Manifest Version: 9.0.51/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.51\WorkloadManifest.json
Install Type: Msi
[android]
Installation Source: VS 17.14.36109.1
Manifest Version: 35.0.61/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.61\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: VS 17.14.36109.1
Manifest Version: 18.4.9288/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.4.9288\WorkloadManifest.json
Install Type: Msi
Configured to use workload sets when installing new manifests.
Workloads are configured to install and update using workload versions, but none were found. Run "dotnet workload restore" to install a workload version.
Host:
Version: 10.0.0-preview.2.25107.7
Architecture: x64
Commit: 7324dd1545
.NET SDKs installed:
6.0.428 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
9.0.106 [C:\Program Files\dotnet\sdk]
9.0.204 [C:\Program Files\dotnet\sdk]
9.0.300-preview.0.25177.5 [C:\Program Files\dotnet\sdk]
9.0.300 [C:\Program Files\dotnet\sdk]
10.0.100-preview.2.25108.4 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.36 [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.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-preview.2.25108.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [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.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-preview.2.25107.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [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.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-preview.2.25107.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