runtime: Unable to find package runtime.win-x86.Microsoft.WindowsDesktop.App when publishing Blazor self hosted
Steps to reproduce
- Delete the .nuget\packages dir (
dotnet nuget locals --clear all) - Clone https://github.com/pranavkm/BlazorPublishRepro
- Open in VS
- Publish WebApplication1.Server to a folder as a self-contained (
win-x86) application
Expected behavior
Things work
Actual behavior
Restore fails:
4>------ Publish started: Project: WebApplication1.Server, Configuration: Release Any CPU ------
Connecting to C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Server\bin\Debug\netcoreapp3.0\publish\...
Restore completed in 583.26 ms for C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Client\WebApplication1.Client.csproj.
Restore completed in 583.11 ms for C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Shared\WebApplication1.Shared.csproj.
C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Server\WebApplication1.Server.csproj(0,0): Error NU1102: Unable to find package runtime.win-x86.Microsoft.WindowsDesktop.App with version (>= 3.0.0-preview4-27611-18)
- Found 43 version(s) in DotNetCore [ Nearest version: 3.0.0-alpha-27309-3 ]
- Found 2 version(s) in nuget.org [ Nearest version: 3.0.0-preview3-27504-2 ]
- Found 0 version(s) in Microsoft Visual Studio Offline Packages
- Found 0 version(s) in https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
- Found 0 version(s) in https://dotnet.myget.org/F/blazor-dev/api/v3/index.json
- Found 0 version(s) in AspNetCore
Restore failed in 1.31 sec for C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Server\WebApplication1.Server.csproj.
C:\Users\prkrishn\source\repos\WebApplication1\WebApplication1.Server\WebApplication1.Server.csproj(0,0): Error NU1102: Unable to find package runtime.win-x86.Microsoft.WindowsDesktop.App with version (>= 3.0.0-preview4-27611-18)
- Found 43 version(s) in DotNetCore [ Nearest version: 3.0.0-alpha-27309-3 ]
- Found 2 version(s) in nuget.org [ Nearest version: 3.0.0-preview3-27504-2 ]
- Found 0 version(s) in Microsoft Visual Studio Offline Packages
- Found 0 version(s) in https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
- Found 0 version(s) in https://dotnet.myget.org/F/blazor-dev/api/v3/index.json
Environment data
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview4-011192
Commit: 4145635c07
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview4-011192\
Host (useful for support):
Version: 3.0.0-preview4-27610-12
Commit: d5a76cb8c0
.NET Core SDKs installed:
2.1.700-preview-009597 [C:\Program Files\dotnet\sdk]
3.0.100-preview4-011192 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview4-19210-17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview4-27610-12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview4-27611-18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
It is weird but by design. We have to download all runtime packs due to having to pick pre-restore before we can apply transitive framework references. Well, what’s weird is that right now, we still haven’t finished transitive framework references, but the part that is picking the runtime packs to download is already being greedy in anticipation.
Hmm, no I think this is different
The project has:
If you change that to
Does it work?
There are some implicit additional sources (which will be gone in Preview 5 --hopefully)
@dagood adding the
dotnet-windowsdesktopfeed does fix the issue. Presumably this package would be published to NuGet.org as part of the preview4 release. That said, would you know why publishing a self-contained WebApplication results in a reference to the WindowsDesktop framework?@dagood I did cheat and just delete the
.nuget/packagesdir prior to running this specific publish. But afaik,dotnet nuget locals --clear allshould wipe out the HTTP cache.