-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet publish --self-contained can't handle build-time references #24434
Comments
Demonstration sample It builds just fine but when you run dotnet publish -r win7-x64, nope! But change everything to .net 5 and there's no problem. |
In other news, it seems the actual reproduction command has gotten lost. It is |
So I've tried to chance this error to its source and found some stuff.
But
thus causing even an explicit framework dependent project to raise 1179. The actual error happens at
which means that SelfContained propagated down the dependent references. |
Describe the bug
Regression from .NET 5
dotnet publish always wants --self-contained or --no-self-contained now and blows up on Any RID references because of it.
To Reproduce
Project file fragment that breaks
These are a build-tool dependencies. They should not (and are not--we excluded it when we pick up from "package") be shipped; furthermore, changing to the Any RID is correct (otherwise cross compilation won't work at all), and furthermore they must not build self-contained.
I cannot omit the
<ProjectReference>
entries or the build becomes unstable. It is absolutely necessary that the top-level build be able to resolve dependencies once and build once; otherwise the build will crash periodically with two copies ofdotnet run
trying to write to thebin
orobj
directories at once.Exceptions (if any)
Further technical details
.NET SDK (reflecting any global.json):
Version: 6.0.201
Commit: ef40e6a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.201\
Host (useful for support):
Version: 6.0.3
Commit: c24d9a9c91
The text was updated successfully, but these errors were encountered: