sdk
sdk copied to clipboard
Workload update reports failure when manifest packages aren't found on feed
Repro
Run the following:
dotnet workload update --source <EMPTY_FOLDER>
Expected
Messages saying "Advertising manifest not updated. Manifest package for <MANIFEST_ID> doesn't exist.", as added in #24678
Actual
Failed to update the advertising manifest microsoft.net.sdk.testworkload: microsoft.net.sdk.testworkload.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.ios: microsoft.net.sdk.ios.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.android: microsoft.net.sdk.android.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: microsoft.net.sdk.maccatalyst.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.macos: microsoft.net.sdk.macos.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.maui: microsoft.net.sdk.maui.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.sdk.tvos: microsoft.net.sdk.tvos.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: microsoft.net.workload.mono.toolchain.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Failed to update the advertising manifest microsoft.net.workload.emscripten: microsoft.net.workload.emscripten.manifest-6.0.400 is not found in NuGet feeds C:\git\repro\WorkloadMsiCreationTesting\Empty".. Garbage collecting for SDK feature band(s) 6.0.400...
Successfully updated workload(s): maui-windows.
Analysis
We thought that a NuGetPackageNotFoundException
exception would be thrown when the package wasn't found. It turns out that in this case at least, a NuGetPackageInstallerException
is thrown. That happens here: https://github.com/dotnet/sdk/blob/dcadb9a2da1d832a2dfb896ae925fa2a28a920c6/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs#L426-L430
Probably we should change that location to throw a NuGetPackageNotFoundException
instead.
Separately, we probably shouldn't print the message "Successfully updated workload(s):" when no workloads have been updated. We should probably instead print something like "No updates found."
It looks like this also prevents the workload fallback from working during an update.
@dsplaisted looks like you took care of this, can this be closed now?
I don't think I addressed the last bit:
Separately, we probably shouldn't print the message "Successfully updated workload(s):" when no workloads have been updated. We should probably instead print something like "No updates found."
We could factor that out into a separate issue.
The success message is still there. Moving this to backlog