This issue has many solutions, please read all answers below, they might help you solve your problem too. If you find a new way to solve this, please document in you
I ended up with 2 runtime assemblyBinding entries for WebGrease. Deleting the older one (version 1.5.2) solved my issue.
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
Just in case it helps anybody, I had the same issue, but found it was caused by a dependent assembly of WebGrease, namely Antlr3
. It had added the following to runtime
element in web.config
when installing via NuGet:
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
Simply removing this fixed my issue.