Support publishing for a RuntimeIdentifier without building for that RuntimeIdentifier
See original GitHub issueThis is similar to #2839, but also involves using the “No Build” option on publish.
So you have a project with:
<RuntimeIdentifiers>A;B;C</RuntimeIdentifiers>
And you do:
dotnet build
dotnet publish -r A --no-restore --no-build
After fixing #2839, the --no-build
scenario is still failing. It looks like this is because the RID-specific app-host isn’t in the intermediate directory and it fails when trying to copy it to the publish directory.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
error NETSDK1031: It is not supported to build or publish a ...
error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier · Ask Question.
Read more >Breaking change: Automatic RuntimeIdentifier - .NET
error NETSDK1031: It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier.
Read more >`RuntimeIdentifier` warning if self-contained is unspecified ...
NET SDK defaults the build, publish, and run outputs to be self-contained applications. The default without specifying a RuntimeIdentifier ...
Read more >Cannot publish self-contained worker project referencing ...
When trying to publish single file exe for worker projects get error runtime identifier is required, but it was!
Read more >It is not supported to publish an app without RuntimeIdentifier
Issue Description: .NET Core build gives below error,. It is not supported to publish an application to a single-file without specifying a RuntimeIdentifier....
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
@peterhuene I think you’re right, it doesn’t really make sense for this to work. I thought that it was a scenario we supported or tried to support in earlier releases, but maybe I’m getting no-build confused with no-restore.
@dsplaisted @livarcocc I originally left a question to this issue which I later deleted because perhaps I wasn’t seeing things correctly.
However, I now would like to ask that question again. How is this supposed to work if we never build for the RID we’re publishing for?
Currently
RuntimeIdentifiers
controls which RIDs we’re restoring for, but not which we’re targeting the build, which can currently only be a single RID specified viaRuntimeIdentifier
. Thus, in the repro steps above,dotnet build
builds RID-agnostic.When we publish
--no-build
for a specified RID from a previous build being RID-agnostic, we have no RID-specific build outputs (either inbin/
orobj/
) to copy to the publish directory.Are we proposing that the presence of
RuntimeIdentifiers
fans out the build the same wayTargetFrameworks
does? That is a requested change from the community (I would have to dig up the issue), albeit a breaking change.If that’s not the case, then I don’t see how the above repro is expected to work.