Closed lewing closed 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
This exposes a limitation in the WorkloadResolver
APIs. On PackInfo
instances, the Path
uses the resolved ID (which takes aliasing into account) so that it's the path to the actual files on disk. However the Id
is the original unresolved ID.
One option would be to change the PackInfo.Id
to the resolved ID. I don't particularly like that, as aliases are supposed to be transparent. An alternative would be to add a new property called NuGetPackageId
or AliasedPackageId
or something specifically for the installer to use.
Fixed by #17227
With the new .NET 6 preview 4, this now fails as well:
➜ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.4.21255.9
Commit: 950e4949a7
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.4.21255.9\
Host (useful for support):
Version: 6.0.0-preview.4.21253.7
Commit: bfd6048a60
.NET SDKs installed:
6.0.100-preview.4.21255.9 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.4.21253.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.4.21253.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.4.21254.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
➜ dotnet workload install microsoft-net-sdk-blazorwebassembly-aot
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.0-preview.4.21253.7...
System.AggregateException: One or more errors occurred. (No NuGet sources are defined or enabled)
---> Microsoft.DotNet.ToolPackage.NuGetPackageInstallerException: No NuGet sources are defined or enabled
at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.LoadNuGetSources(PackageSourceLocation packageSourceLocation) in dotnet.dll:token 0x6000a18+0xfd
at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.DownloadPackageAsync(PackageId packageId, NuGetVersion packageVersion, PackageSourceLocation packageSourceLocation, Boolean includePreview) in dotnet.dll:token 0x6000a14+0x2f
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) in System.Private.CoreLib.dll:token 0x6002d42+0x11
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) in System.Private.CoreLib.dll:token 0x6002c56+0x2b
at System.Threading.Tasks.Task`1.get_Result() in System.Private.CoreLib.dll:token 0x6002c54+0x8
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.<>c__DisplayClass14_0.<InstallWorkloadPack>b__0() in dotnet.dll:token 0x6000b0e+0x41
at Microsoft.DotNet.Cli.TransactionalAction.<>c__DisplayClass2_0.<Run>b__0() in dotnet.dll:token 0x6000cef+0x0
at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x35
at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.InstallWorkloadPack(PackInfo packInfo, SdkFeatureBand sdkFeatureBand, Boolean useOfflineCache) in dotnet.dll:token 0x60001bc+0x7e
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.<>c__DisplayClass14_1.<InstallWorkloadsWithInstallRecord>b__2() in dotnet.dll:token 0x6000b1f+0x15
at Microsoft.DotNet.Cli.TransactionalAction.<>c__DisplayClass2_0.<Run>b__0() in dotnet.dll:token 0x6000cef+0x0
at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback) in dotnet.dll:token 0x6000922+0x35
at Microsoft.DotNet.Cli.TransactionalAction.Run(Action action, Action commit, Action rollback) in dotnet.dll:token 0x6000923+0x19
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloadsWithInstallRecord(IEnumerable`1 workloadIds, SdkFeatureBand sdkFeatureBand) in dotnet.dll:token 0x60001cf+0xb5
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable`1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x58
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216
at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008af+0x5e
at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000918+0x2e8
at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000916+0x6f
It looks like the error is:
NuGetPackageInstallerException: No NuGet sources are defined or enabled
This indicates that your nuget configuration is probably flawed, do you have a nuget.config file that's being picked up? If so, what is the content?
dotnet workload install microsoft-net-sdk-blazorwebassembly-aot --skip-manifest-update=true
Fails to install all the packs because it doesn't account for the alias-to attributes correctly
the failing pack (in the baseline manifest is)
so it should be trying to install
microsoft.netcore.app.runtime.aot.osx-x64.cross.browser-wasm.6.0.0-preview.4.21222.10
notmicrosoft.netcore.app.runtime.aot.cross.browser-wasm.6.0.0-preview.4.21222.10