ASP.NET Core app (TargetFramework .NetFramework) hosted in a Windows Service, with a reference to an .NetStandard project.
- Publish the wep app to the outpout folder.
- To install the service run in the cmd: "AspNetCoreApp.Service --install"
- Browse http://localhost:5000 to access to the webapp.
- To uninstall the service run in the cmd "AspNetCoreApp.Service --uninstall"
Make the .NET Framework project a ProjectReference based project by setting the following property in the project in the csproj:
<RestoreProjectStyle> PackageReference </RestoreProjectStyle>
There is also a good change you will need auto-bindingredirects as well so make sure that is set in your project:
<AutoGenerateBindingRedirects> true </AutoGenerateBindingRedirects>
References: