'Nuget Failed to install package "RazorGenerator.Mvc" with specific version 2.3.12
I had this error while trying to install Nuget package "RazorGenerator.Mvc" with the specific version 2.3.12 using this command:
Install-Package RazorGenerator.Mvc -Version 2.3.12
However, when running the command, Visual Studio returned this error:
Failed to add reference. The package 'RazorGenerator.Mvc' tried to add a framework reference to 'System.Web.Mvc' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance. Cannot find assembly 'System.Web.Mvc'.
My project already has the package "Microsoft.AspNet.Mvc" installed with the latest version, I have also tried installing this package with version 3.0.50813.1 but both attempts didn't resolve the error. Do you guys have any idea how to fix this issue? The specific version of the package "RazorGenerator.Mvc" has to be 2.3.12.
Solution 1:[1]
You can try any of these 3 things:
From Nuget package manager, Uninstall the package "Microsoft.AspNet.Mvc" from your project and then try installing the specific version of the package "RazorGenerator.Mvc" i.e. 2.3.12 (RazorGenerator.Mvc will install all the dependencies)
Cross check whether it is not your target framework of the project that is causing this issue. In short, check whether you need your project with .Net Framework or .NetCore in order to install this nuget package.
Remove any dlls,exe from bin/ debug folder and try installing the nuget again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sunny |
