0

I have a .Net Standard 2.0 class library project created in Visual Studio 2017, to which I generate a NuGet package (by checking the "Generate NuGet Package on Build" option in the project properties). I have another project which targets .Net Framework 4.6.1 and I want it to reference my NuGet package. When I do, I get the following error:

You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', 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

(The funny thing is that I'm the package author... :-) )

Note that if I reference the DLL directly it works without a problem. It's just when I try to add the reference as a NuGet package that I get this error.

Any help is appreciated...

Arnon Axelrod
  • 1,444
  • 2
  • 13
  • 21
  • which Nuget version is installed into vs 2015? – Martin Ullrich May 30 '19 at 13:23
  • NuGet 3.6 and above is needed if you use VS2015, https://github.com/dotnet/announcements/issues/24 – Lex Li May 30 '19 at 14:17
  • 1
    Thanks @LexLi! I installed NuGet 3.6 and then I got a message `To reference a library that targets .NET Standard 1.5 or higher, you need to install the .NET Standard Build Support extension for the .NET Framework from https://aka.ms/netstandard-build-support-netfx` in the output window. After installing the extension I restarted VS and viola! the package was added to my project. You're welcome to write it as an answer and I'll mark it as accepted. – Arnon Axelrod May 30 '19 at 15:47
  • I also had this issue: https://github.com/dotnet/sdk/issues/1539 but the mentioned workaround resolved it. – Arnon Axelrod May 30 '19 at 15:59
  • Indeed a duplicate. Don't know how I missed it. Though the solution is not in the marked answer. – Arnon Axelrod Jun 02 '19 at 02:54

0 Answers0