Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies

前端 未结 18 1786
夕颜
夕颜 2021-01-31 07:02

I have an MVC4 Web API project. While running the service project I am getting an error

Could not load file or assembly \'WebGrease, Version=1.5.1.25624,

18条回答
  •  死守一世寂寞
    2021-01-31 07:46

    I know it's kind of late for the OP but I ran into the same problem while trying out the Bootstrap 3 for MVC 4 NuGet package, in my case it had something to do with the Microsoft.AspNet.Web.Optimization package, and managed to find a simple solution.

    Try executing the following commands in the package manager console:

    Install-Package Microsoft.AspNet.Web.Optimization
    Update-Package WebGrease
    Uninstall-Package Microsoft.AspNet.Web.Optimization
    Uninstall-Package WebGrease
    Install-Package Microsoft.AspNet.Web.Optimization
    Update-Package WebGrease
    

    The first two lines had no effect for me since those packages were already installed and updated by the Bootstrap 3 for MVC 4 package, but I ran them anyway and then it all compiled and ran great.

提交回复
热议问题