Open kkwpsv opened 5 years ago
This should actually be fixed in .NET Core 3.0, even once there is a patch version.
For .NET Core 2.x, you should be able to work around the issue by setting TargetLatestRuntimePatch to true in the ConsoleApp. Here's some more information: https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-patch-selection
I have two projects. One is a ConsoleApp, the other is WebApplication. And the WebApplication has a
ProjectReference
to reference the ConsoleApp.When I publish the WebApplication with
--runtime
, it has an error like below:But when I remove the
<OutputType>Exe</OutputType>
line from the csproj of ConsoleApp, it succeeds.I have done many tests:
If I only publish the ConsoleApp with
--runtime
and<OutputType>Exe</OutputType>
, it will success.If I publish the WebApplication with
--runtime
and<OutputType>Exe</OutputType>
, it will fail, no matter on Linux or Windows, no matter with .net core 2.1 or 2.2. But it will succeed with .net core 3.0. (I think it's because that there's no any .net core 3.0.x)If I publish the WebApplication with
--runtime
and without<OutputType>Exe</OutputType>
, it will always succeed.If I publish the WebApplication without
--runtime
and with<OutputType>Exe</OutputType>
, it will always succeed.