dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.75k stars 1.07k forks source link

[NETSDKE2E][Workload set]After running "dotnet workload update" and clicking "No" first and then "Yes" on UAC prompt, Unhandled exception " Workload update failed:System.IO.FileNotFoundException: Workload version 9.0.100-servicing.24530.1..., was not found." occurs #44546

Open vdanche opened 3 weeks ago

vdanche commented 3 weeks ago

Build: 9.0.100 SDK on win11-x64

1.dotnet workload install aspire --version 9.0.100-servicing.24530.1 2.dotnet workload update 3.A UAC prompt will popup, select No. (UAC prompt will popup many times after selecting No) 4.The second UAC prompt popup, select No. 5.The third UAC prompt popup, select yes.

Expected Result: After step5, workload should be updated without any error.

Actual Result: Workload update failed: Workload version 9.0.100-servicing.24530.1, which was specified in C:\ProgramData\dotnet\workloads\X64\9.0.100\InstallState\default.json, was not found.

Also failed after running "dotnet workload --info" Image

https://github.com/user-attachments/assets/4c858e31-60e8-4b5b-aec3-6f54e821312f

Note: All dotnet workload command are broken. Image

C:\Users\v-danche>dotnet --info .NET SDK: Version: 9.0.100 Commit: 59db016f11 System.IO.FileNotFoundException: Workload version 9.0.100-servicing.24530.1, which was specified in C:\ProgramData\dotnet\workloads\X64\9.0.100\InstallState\default.json, was not found. at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.RefreshWorkloadManifests() at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider..ctor(String sdkRootPath, String sdkVersion, Func2 getEnvironmentVariable, String userProfileDir, String globalJsonPath, String workloadSetVersion) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider..ctor(String sdkRootPath, String sdkVersion, String userProfileDir, String globalJsonPath) at Microsoft.DotNet.Workloads.Workload.List.WorkloadInfoHelper..ctor(Boolean isInteractive, VerbosityOptions verbosity, String targetSdkVersion, Nullable1 verifySignatures, IReporter reporter, IWorkloadInstallationRecordRepository workloadRecordRepo, String currentSdkVersion, String dotnetDir, String userProfileDir, IWorkloadResolver workloadResolver) at Microsoft.DotNet.Cli.WorkloadCommandParser.GetWorkloadsVersion(WorkloadInfoHelper workloadInfoHelper) at Microsoft.DotNet.Cli.CommandLineInfo.PrintInfo() at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args)

Host: Version: 9.0.0 Architecture: x64 Commit: 9d5a6a9aa4 RID: win-x64

.NET SDKs installed: 9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: None

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

v-ainigao commented 3 weeks ago

This issue also repro's on arm64OS Image

marcpopMSFT commented 3 weeks ago

We probably shouldn't put you in a bad state but it seems pretty reasonable for workload install/update to fail if you click no. We're not asking again for the same command but rather for a future command. We should catch you said no and then stop trying.

marcpopMSFT commented 3 weeks ago

Not a blocker