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
msbuild fail : need to set SelfContained to false or UseAppHost to true #2505
Comments
|
You don't need to set UseAppHost. cc @peterhuene |
|
Hi @TimRowe. The SDK should be defaulting If possible, could you share a repro project or repro steps for me to take a look at? Thank you! |
|
@peterhuene I think I found the problem. At first, my publish cmd is like below Now I add the But I am confused, because |
|
I think I see what's happening here. The reason you do not observe the problem when you specify However, when you publish without specifying This is an unfortunate regression that did not take into account users that would be setting The best workaround for you is to also set I'll see if there's a way we can fix this, such as checking to see if |
|
@peterhuene Thanks for your detailed analysis. RuntimeIndentifier(DotNet Cli)> RuntimeIndentifier(Profile.pubxml ) > SelfContained( DotNet Cli ) > SelfContained( Profile.pubxml ) > UseAppHost( DotNet Cli ) > UseAppHost( Profile.pubxml ) |
|
Hi @TimRowe. It's about order of evaluation and having a global property set. When you specify
Contrast this to not passing If the publishing profile also sets |
|
@peterhuene thansk, it's clear. |
|
That's unexpected, since the publish items (including the executable apphost) should not be added to the evaluation until after the publish profile has been evaluated (i.e. when the publish targets are actually running), otherwise I would expect setting Are you seeing a self-contained deployment, but just the .exe is missing? That is to say, the rest of the framework files are present? I'll see what I can figure out. |
|
@peterhuene Here is the sample project. |
|
Hi @TimRowe, Thanks for the repro project. I can confirm the behavior you're seeing, although it does not appear to be a regression related to the I am seeing I think the publish profile is being applied "too late" for logic in the SDK to respect it properly. A workaround for now is to pass the runtime to the publish command (i.e. I'll investigate the root cause of that behavior. Thanks again for reporting this to us! |
|
@peterhuene thanks,This is what I should do. I hope the next version will optimize these problems. |
|
@peterhuene Is there a solution when using msbuild.exe, or is |
|
@HolisticDeveloper you should be able to work around this similarly with |
|
This should now be fixed with the upcoming preview of the .NET Core 3.0 SDK. Fixed in #3183. |
When I update .net core sdk to 2.1.4, error raised when my project was built to publish.
C:\Program Files (x86)\dotnet\sdk\2.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(122,5): error NETSDK1067: Self-contained applications are required to use the application host. Either set SelfContained to false or set UseAppHost to true. [C:\Program Files (x86)\Jenkins\workspace\TMQ4.DEV\Tmq.Web\Tmq.Web.csproj]My publication Profile.pubxml is like below:
The profile.pubxml was created by visual studio with publication gui config.
When I add item
to PropertyGroup, It was fine.
1、When was it be introduced?
2、Who can show detail about UseAppHost ?
3、Is it conflict with SelfContained, I think SelfContained Setting is enough?
The text was updated successfully, but these errors were encountered: