While upgrading WebGrease
to version 1.3.0
gets me error:
Could not load file or assembly \'WebGrease, Version=1.0.0.0, Cult
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> </dependentAssembly>
Change the upper code in Web.config
to the following
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0"/> </dependentAssembly>
Same deal as Hriju and Nathan (Uninstall, re-install and update), only instead of omitting the newVersion
attribute, I kept it. But since WebGrease went from 1.1.0 straight to 1.3.0, there was no need for 1.2.0 (as jenson-button-event had it) (Good luck to JB in Spain, btw).
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.3.0.0" />
Pedantic? Maybe, but it's always in the details, right? This fixed it for me.
Anyhow, here's to hoping they do it right on the next update.
It looks like you have reference to older (1.0.0.0?) version of assembly (assuming current version is 1.3.0.0). In this case you need assembly redirect in web.config or better yet recompile your binaries to use latest version.
Another possiblity if latest version shares the same assembly version as old one (1.0.0.0) you need to recompile your code to use the right assembly and make sure correct copy is used (check GAC for wrong one, use fuslogv to investigate what exact file caused the error).
For a Web API project I'm working on what really worked was the following:
Open NuGet package manager, click in Installed packages
and then uninstall Microsoft.AspNet.Web.Optimization
. It prompts it'll remove WebGrease 1.1.0
. Hit Yes
.
Now reinstall it clicking NuGet's Online tab and search for Microsoft.AspNet.Web.Optimization
.
Now everything is working as expected.
Thanks to @roadsunknown. My configuration got hosed after my host machine froze, thus causing my VM to not shutdown properly. To resolve this I uninstalled Microsoft.AspNet.Web.Optimization through NuGet, then had to remove the reference to WebGrease in packages.config, and finally reinstalled Microsoft.AspNet.Web.Optimization through NuGet.
In my case all this methods didn't work. Finally I resolve this problem by uninstalling Microsoft.AspNet.Web.Optimization and WebGrease Packages via Package Manager, then I open my project file (.csproj) in notepad and delete all entries related to this two Packages, turn outs that there was problem. Finally I install this two packages via package manager again and run project. All work's fine now.