windows arm64 dotnet SDK fails to publish self-contained
See original GitHub issueDescribe the bug
The dotnet CLI on a Windows ARM64 machine cannot publish a self-contained application
To Reproduce
On a Windows ARM64 device (e.g. Surface Pro X):
- Download https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-6.0.100-preview.7-windows-arm64-binaries
- Create a new application:
dotnet new console
- Attempt to publish it:
dotnet publish -r win-arm64 --self-contained /p:PublishSingleFile=true
# results in: error NU1100: Unable to resolve 'Microsoft.NETCore.App.Runtime.win-arm64 (= 6.0.0-preview.7.21377.19)' for 'net6.0'.
It’s worth noting within WSL2, the Linux ARM64 dotnet 6 SDK Preview does not have this problem i.e. ARM64 Linux can successfully cross compile for the same target runtime, win-arm64, so this bug appears to be specifically for the Windows ARM64 version of the dotnet 6 SDK. More details below:
Exceptions (if any)
Microsoft (R) Build Engine version 17.0.0-preview-21378-03+d592862ed for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
C:\Users\guide2wsl\Documents\Programming\first\first.csproj : error NU1100: Unable to resolve 'Microsoft.NETCore.App.Runtime.win-arm64 (= 6.0.0-preview.7.21377.19)' for 'net6.0'.
C:\Users\guide2wsl\Documents\Programming\first\first.csproj : error NU1100: Unable to resolve 'Microsoft.WindowsDesktop.App.Runtime.win-arm64 (= 6.0.0-preview.7.21378.9)' for 'net6.0'.
C:\Users\guide2wsl\Documents\Programming\first\first.csproj : error NU1100: Unable to resolve 'Microsoft.AspNetCore.App.Runtime.win-arm64 (= 6.0.0-preview.7.21378.6)' for 'net6.0'.
Failed to restore C:\Users\guide2wsl\Documents\Programming\first\first.csproj (in 167 ms).
Further technical details
Edition Windows 11 Home Version 21H2 OS build 22000.176
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21379.14
Commit: 22d70b47bc
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-arm64
Base Path: C:\Users\guide2wsl\Applications\dotnet\sdk\6.0.100-preview.7.21379.14\
Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d
.NET SDKs installed:
6.0.100-preview.7.21379.14 [C:\Users\guide2wsl\Applications\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [C:\Users\guide2wsl\Applications\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [C:\Users\guide2wsl\Applications\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [C:\Users\guide2wsl\Applications\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Please investigate, thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Self-Contained Single-File does not produce a single file
Net 5 console application with no dependencies on third party components. I have set it up to publish as a self-contained single-file.
Read more >Solved: Publish/Deploy self-contained win-x64 not working
I'm using Esri.ArcGISRuntime.WPF v200.0.0 in a WPF + NET7 application. I am publishing it as self-contained win-x64.
Read more >Publish to arm64 not working when cultured resx file added
Is there a way to make the publish succesfull? Is there a better way to do localization for .net 6.0 projects that need...
Read more >I get ".NET location: not found" error on Linux when running ...
You are trying to run the resulting binaries from a build that wasn't published as a self-contained application within a container that doesn't ......
Read more >Dotnet build linux. The answer you're looking for is basically
1. peace When I deploy to Linux, I publish the application on Windows and copy ... The dotnet sdk ships with a self-contained...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I’m seeing the same thing on win-x64. Just installed .NET 6.0 this morning. I’ve never done .NET development on this machine before. Don’t have Visual Studio. Working with CLI and VS Code.
Using
<PublishSingleFile>true</PublishSingleFile>
in my csproj turns the error on and off for me. Set totrue
and it asks for a runtime, so I rundotnet publish -r win-x64
and get the NU1100 errors. Use<PublishSingleFile>false</PublishSingleFile>
and it works.Output of dotnet --info:
I also had
So as I saw above, I ran
dotnet nuget add source -n nuget.org https://api.nuget.org/v3/index.json
then I was able to rundotnet publish
with<PublishSingleFile>true</PublishSingleFile>
and<RuntimeIdentifier>win-x64</RuntimeIdentifier>
right below but this still didn’t produce single-file output.I was able to get single file output by running
dotnet publish -r win-x64 --no-self-contained
. I got a warning from the CLI that I needed to use either--self-contained
or--no-self-contained
.So if you want to publish framework-dependent single file output you need:
I spoke too soon, I can still reproduce with the .NET 6 rc1 SDK. It turns out on Windows when you run:
More than just: $HOME\.nuget is modified
so wiping that directory alone on Windows wasn’t enough to confirm this was resolved.