I tried the other answers. I also tried many combinations of restoring, upgrading, downgrading, reinstallation of the WebGrease and Antlr packages. At runtime, I was still getting ReflectionTypeLoadException thrown with LoaderExceptions that displayed the version number (3.4.1.9004) of the older Antlr that had been replaced.
I also tried the following, which took me a couple days to test, and none of which resolved the issue:
- Clearing the temporary files.
- Reloading Visual Studio and the Solution.
- Rebooting my development computer.
- Removing the "Specific version" flag on references.
What finally worked was adding a binding redirect in the web.config file. Since the older version of WebGrease had not been updated by NuGet either, I replaced them both with:
</runtime>
</assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<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>
</assemblyBinding>
</runtime>
After recompiling and deploying my application, then it got rid of the complaints.