-
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
Self-contained publish of a Exe project referencing another Exe project #9534
Comments
cc @dsplaisted to help with a workaround. |
@dsplaisted @nguerrera Hypothesis: I think an issue here is also that NuGet doesn't use the same property exclusions as project reference builds use. NuGet does |
cc @peterhuene |
It looks like this may be the same issue as, or related to, #1834 As a workaround, you can try putting the following in the referenced Exe project: <PropertyGroup>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> (You can also set the property to false if you don't intend to publish that project as self-contained). |
@dsplaisted unfortunately that fix didn't work for me, i am getting:
If i get diag logs, i can see that runtime identifier has been unset for the dependent exe project :/ |
Any news or workaround in this topic? |
@wolszakp sorry. This is not something we have prioritized at the moment. |
Steps to reproduce
Actual behavior
publish fails with
Expected behavior
Produce a self-contained executable in projA\out\projA.exe
projA.exe will start at projA's entry point but it may call code in projB.
Understood that the SCD should use the latest runtime patch available on my machine, which is 2.1.1. This is according to docs on Self-contained deployment runtime roll forward.
Note that if projB's
OutputType
is changed toLibrary
instead ofExe
then the publish succeeds. But we expect that a P2P reference from oneExe
to anotherExe
should also work because in a different build scenario, we may still want to publish projB as a separate self-containedExe
.Ideally, the shared code could be reorganized into a third
Library
project which is a dependency to both, but in this case, projA refers directly to projB. Is this supported?publish
in step 5 implicitlyrestore
s projA and its dependency projB. projA is treated as a SCD according the command line arguments, but I guess projB somehow does not get the same SelfContained or RuntimeIdentifier flags since its runtime is not rolled forward. I've seen other issues discussing how the RID gets passed through (#9514) but this seems to be a different problem where projB'sOutputType
as anExe
is significant.Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: