PublishSingleFile with RuntimeIdentifiers fail to publish
See original GitHub issue@johnlarfour commented on Tue Jun 11 2019
linux/amd64 dotnet 3.0.100-preview5-011568
Step to reproduce:
dotnet new console -o app
Replace csproj with:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RuntimeIdentifiers>linux-x64;win-x86;osx-x64</RuntimeIdentifiers>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
</Project>
cd app
dotnet publish
Error:
/home/john/dotnet/sdk/3.0.100-preview5-011568/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(133,5): error NETSDK1097: It is not supported to publish an application to a single-file without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set PublishSingleFile to false. [/home/john/Desktop/app/app.csproj]
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
It is not supported to publish an app without RuntimeIdentifier
The issue I found to be not specifying the runtime identifier in the project file or through the publish command. When choosing an...
Read more >error NETSDK1031: It is not supported to build or publish a ...
I am running following command to publish .NET CORE 5.0 web api project using command line on windows 10 box. c:\test\Service>dotnet publish -c ......
Read more >Breaking change: Automatic RuntimeIdentifier - .NET
Learn about a breaking change in the .NET 7 SDK where a RuntimeIdentifier is automatically added to projects that use certain publish ......
Read more >Unable to publish single-file application (.NET 5)
1. Close tab publish · 2. Open file "ClickOnceProfile.pubxml", located in Properties\PublishProfiles of project · 3. Make some changes, for ...
Read more >dotnet publish: specify RuntimeIdentifier
Ever came across this error on publishing a dotnet project that includes ... specify a RuntimeIdentifier or set PublishSingleFile to false.
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
You need to specify a single RuntimeIdentifier when publishing with Single File. The error message is correct and accurate in this case.
You can try to either edit your csproj to contain a single RuntimeIdentifier, like this
Or, you can pass the -r parameter to the dotnet publish command.
This is really unexpected behavior. Any plans to change it? Running a dotnet publish for each runtime seems unnecessary if a
RuntimeIdentifiers
exists which could build for multiple runtimes at once.