System.Web.Optimization and Microsoft.Web.Optimization won't load reference in vs 2012

前端 未结 12 1311
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 01:46

I\'m working on an MVC 4 project started in Visual Studio 2010. Right now I\'m working on a machine with Visual Studio 2012 as I don\'t have access to the machine I was original

12条回答
  •  遇见更好的自我
    2021-02-05 02:23

    I battled this for an hour and none of the above suggestions worked. In the end only the following worked (for some obtuse reason) :

    1. ctrl-q -> type "package manager console"
    2. Uninstall-Package Microsoft.AspNet.Web.Optimization
    3. Install-Package Microsoft.AspNet.Web.Optimization

    WARNING/HEADS-UP

    • the above will install the latest version of Microsoft.AspNet.Web.Optimization. If you want a particular version (say v1.1.1), use Install-Package Microsoft.AspNet.Web.Optimization -Version 1.1.1
    • don't forget the parameter or nuget will operate at the Solution-level, possibly trampling sibling projects.
    • Note that omitting the project name is an of itself really handy for doing Solution-level version updates or package installs.

提交回复
热议问题