0

I have created .net standard library project and I have created nuget package for this library, Now I need to install this package in both application .Net Core and .Net Framework4.5. Working fine in .Net Core but while installing .Net framework project it was showing below exception.

You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Please let me know the right approach to resolve this.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Sivakumar
  • 345
  • 4
  • 14
  • 1
    You do not say what .NET standard version your project targets. I am guessing that it targets 1.3 or above which is not compatible with .NET Framework 4.5.2. The support mappings are documented in this table - https://learn.microsoft.com/en-us/dotnet/standard/net-standard – Matt Ward Jun 15 '20 at 19:43

1 Answers1

0

The library that you have created targets .NET Standard 2.0, as stated in your tags. .NET Framework 4.5.2 does only implement .NET Standard up to version 1.2, that is why the assemblies are not compatible.

You should change your library to a .NET Standard version that is implemented by both .NET Core and .NET Framework or upgrade your .NET Framework version accordingly.

You can find the version mappings here, credits to @Matt Ward for providing the source.

thatguy
  • 21,059
  • 6
  • 30
  • 40