I'm trying to add a .NET 4 libary to a .NET 4.5.1 solution with NuGet. This should generate the following entry in packages.config and reference the dll.
<package id="MyCompany.MyApi" version="2.0.1-alpha0680" targetFramework="net451" />
However, the error that I'm getting is:
Error: Failed to add reference to 'mscorlib'.
What does work is the following:
- Add the NuGet package in packages.config
- Reference the dll in the packages folder manually
But obviously this is not my preferred solution.
Edit: This is not a duplicate of the referenced question. This issue also occurs when I create a blank console application. So there isn't even a packages folder yet to clear.