-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Runtime identifier is not forwarded when publishing exe project references (self-contained mode) #16184
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
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I've noticed the same problem. It seems instead of specifying SkipGetTargetFrameworkProperties in A.csproj another workaround is to specify RuntimeIdentifiers in B.csproj. Something like this It would be nice if someone with a better understanding could elaborate on this. |
Same, it caused inconvenience when publishing a project that references many other projects. |
I noticed that the In my case, this situation happened because of a Here's a different workaround, in case it helps anyone: <Target Name="AddReferencedExeProjectForPublish" BeforeTargets="CopyFilesToPublishDirectory">
<MSBuild Projects="..\B\B.csproj" Targets="Publish" Properties="PublishDir=$([System.IO.Path]::GetFullPath($(PublishDir)))" BuildInParallel="$(BuildInParallel)" />
</Target> It essentially publishes |
This may be the same as or related to #21677 |
Co-authored-by: Michael Simons <[email protected]>
This is a follow-up to #1675 and #14488. Tested with the SDK v5.0.200.
If you have a project A that references a project B, and both are of the exe output type, then publishing A with a runtime identifier will generate a self-contained A, but a framework-dependent B.
Here's a simple repro:
A.deps.json
will have the.NETCoreApp,Version=v5.0/win-x64
runtime target, andB.deps.json
will have.NETCoreApp,Version=v5.0
.Workaround:
If you change the project reference to the following:
Then B will be published in self-contained mode as expected.
/cc @dsplaisted
The text was updated successfully, but these errors were encountered: