Search code examples
visual-studionugetimagesharp

NuGet failed installing ImageSharp


I have been trying to install the imagesharp package via NuGet, but I am getting an error from the output window below:

Restoring packages for C:\Users\mycomp\Source\Repos\WebApplication\WebApplication1\WebApplication1.csproj...
Package SixLabors.ImageSharp 1.0.0-beta0001 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package SixLabors.ImageSharp 1.0.0-beta0001 supports:
 - netstandard1.1 (.NETStandard,Version=v1.1)
 - netstandard1.3 (.NETStandard,Version=v1.3)
 Package restore failed. Rolling back package changes for 'WebApplication1'.
Time Elapsed: 00:00:00.9032282
 ========== Finished ==========

And here from the Error List window:

    Error       Package restore failed. Rolling back package changes for 'WebApplication1'.

I tried repairing VS 15.4.0 and also updating to VS 15.4.2, but none of it is fixing my issue....any thoughts?


Solution

  • The answer was quite simple in the end. It had nothing to do with the compatibility of the netcoreapp2.0, or either the netstandards1.1/netstandard1.3. That was just a symptom of the real issue. This is how I fixed it:

    Tools>Options>NuGet Package Manager>Clear All NuGet Cache/s.

    I did get another error while uninstalling from NuGet manager stating access denied to remove the BuildBundlerMinifier package, so I manually deleted it from my .nuget folder, installed SixLabors.ImageSharp package, then reinstalled the BuildBundlerMinifier again, then VOILA! It worked.

    Every option that I did try to search for, were either confusing or totally unnecessary.

    There is high probability that if you do run into any weird issues like this while installing/uninstalling your NuGet packages, its due to your NuGet cache folder/s.