Q:

How to compile .NET Core 2.1 API project to target .NET Framework 4.7

As the title suggests, I need to modify the target of compiling a .NET Core 2.1 API project to make it run as .NET Framwork 4.7.
I tried with the mere editing of the .csprj file but not enough, I think the problem is related to the packages included in Microsoft.AspNetCore.App, but I can not figure out how to solve. Does anyone have any idea how to do it?
Just for the news I need to do this thing to be able to publish in Hosting Aruba that currently does not have .NET Core included in IIS (and I do not even install it ...).
Thanks in advance for every suggestion.
Riccardo

A:

As you rightly mentioned, Microsoft.AspNetCore.App is not compatible with .NET Framework.
From the project file remove the reference to it and replace it with the compatible package:
  <PropertyGroup>
    <TargetFramework>net47</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="2.1.4" />
  </ItemGroup>

