When trying to publish a dotnet core 2.2 project combined with using the package "Microsoft.NET.Test.Sdk" Version="15.9.0" the publish of the self-contained project fails.
See the repo i have made for reproduction
https://github.com/Rotvig/Publish.SelfContained.NetCore.2.2
Use package "PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0""
Run command "dotnet publish -c release -r win10-x64 --self-contained"
I expected a self-contained application
Getting error "C:\Program Files\dotnet\sdk\2.2.103\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:\Users\rener\OneDrive\Desktop\Publish.Test\Publish.Test\Publish.Test.csproj]"
Please share test platform diagnostics logs. Instructions to collect logs are here.
The logs may contain test assembly paths, kindly review and mask those before sharing.
Dotnet Core SDK 2.2.103 to publish
Operating system Windows 10
@Rotvig the parameter UseAppHost must be set to true when using --self-contained
dotnet publish -c release -r win10-x64 --self-contained true /p:useapphost=true should work for you
it works thanks !
But shouldn't /p:useapphost be set to true by default when --self-contained is set to true ?
it works thanks !
But shouldn't /p:useapphost be set to true by default when --self-contained is set to true ?
Seems fair, maybe you could take it up with the dotnet repo
Most helpful comment
@Rotvig the parameter
UseAppHostmust be set to true when using--self-containeddotnet publish -c release -r win10-x64 --self-contained true /p:useapphost=trueshould work for you