After upgrading to webgrease 1.5.1.25624 from nuget, System.IO.FileLoadException is coming

37

I am asp.net death page, this is coming after i upgraded webgrease and bootstrap for mvc4 using nuget.

Server Error in '/' Application.


Could not load file or assembly 'WebGrease' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'WebGrease' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'WebGrease' could not be loaded.


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045

asp.net-mvc-4
webgrease
asked on Stack Overflow Jul 16, 2013 by Isaiyavan Babu Karan • edited Jul 26, 2013 by DontVoteMeDown

5 Answers

36

Force uninstall the package using Package Manager Console

uninstall-package -f WebGrease

then install the previous version 1.3.0 using the following command

install-package WebGrease -Version 1.3.0

Open your Web.config file and replace below dependency under runtime tag

<dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />

answered on Stack Overflow Jul 16, 2013 by MSRS
8

I had to add the following code in web.config:

    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
        </dependentAssembly>
...
answered on Stack Overflow Oct 7, 2013 by Dunken
5

I had the same error. It was happened because nuget updated WebGrease dll but didn't update a web.config file (especial version of used dll).

So I changed next line in my web.config:

 <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />

to

<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />

Number of version (1.6.5135.21930) I took from dll properties.

After this everything works correct.

answered on Stack Overflow Jun 6, 2014 by RredCat
3

We’re aware of an error in the assembly’s strong name signature and so we’re actively working to release an updated version as soon as possible. For now, we have unlisted the WebGrease 1.5.1 package from nuget.org.

answered on Stack Overflow Jul 16, 2013 by eugchi
0

Try this: Check if the above dll's are in GAC. If so, in your custom app bin folder check if the above dll's are present if so remove them from your reference.

answered on Stack Overflow Jul 16, 2013 by GodLovesYou

User contributions licensed under CC BY-SA 3.0