I am currently using asp.net-core 2.1 with several .net-core 2.1 libraries. Two of the projects are based on an ef-core 2.1 library and a model library. I now need to develop a Windows service that references both of those projects, I assumed I could simply switch them to netstandard 2.0.
According to Package Microsoft.AspNetCore.All 2.1.0 is not compatible with netcoreapp2.0, this is possible, however I have the following set in the asp.net core project (using sdk 2.1.400):
<TargetFramework>netcoreapp2.1</TargetFramework>
but it fails to compile with:
NU1202 Package Microsoft.AspNetCore.App 2.1.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Microsoft.AspNetCore.App 2.1.0 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)
Anyone know how I can leverage the ef core and model libs in a Windows service?
Microsoft.AspNetCore.App
. Why do generic assemblies need to have such (ASP.NET Core specific) references?<PackageReference Include="Microsoft.AspNetCore.App" />
as there are several attributes from theMicrosoft.AspNetCore.Mvc
namespace. Referencing the explicit deps instead worked. Write your comment up as an answer, and thank you very much.