2
votes

We have a .NET Core web application that uses httpsys. We are in the process of upgrading it from .NET Core 2.2 to .NET Core 3.1 and I observed something strange in the output dir.

The .csproj (the relevant parts) is

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup Label="Globals">
    <Platforms>x64</Platforms>
  </PropertyGroup>

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
    <OutputType>Exe</OutputType>
  </PropertyGroup>

The project is published with the following arguments:

dotnet publish -c release -o .\pkg .\SomeProject.csproj

Before changing the TargetFramework to netcoreapp3.1 (it was netcoreapp2.2) the outputfolder did not contain a dotnet.exe. However, since the upgrade it does. And it seems a bit strange, because the exe is dated 15-6-2016 and has version number 1.0.1.4500.

I can't find any documentation on this change. Why is this executable in my outputdir, why did this change?

1

1 Answers

0
votes

The problem that we experienced is caused by the nuget package ChilkatDnCore. It has a dependency on Microsoft.NETCore.App (>= 1.0.5). With .NET Core 2.2 this package was upgraded to 2.2.8 (the latest version on nuget). With .NET Core 3.1 this package is no longer published. This caused a dependency on the wrong .NET Core dlls, causing an older dotnet.exe to be copied to the output folder.

We tried two solutions (with success): 1. we removed the dependency on ChilkatDnCore. .NET Core 3.1 offers more certificate handling, so the dependency was no longer needed. 2. we created a custom version of the nuget package without the dependency on Microsoft.NETCore.App. Apparently it is not needed for .NET Core Apps.