question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support publishing for a RuntimeIdentifier without building for that RuntimeIdentifier

See original GitHub issue

This 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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dsplaistedcommented, Jul 23, 2019

@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.

1reaction
peterhuenecommented, Jun 7, 2019

@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 via RuntimeIdentifier. 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 in bin/ or obj/) to copy to the publish directory.

Are we proposing that the presence of RuntimeIdentifiers fans out the build the same way TargetFrameworks 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found