Could not load file or assembly 'WebGrease' one of its dependencies. The located assembly's manifest definition does not match the assembly reference

前端 未结 8 1514
终归单人心
终归单人心 2021-01-03 22:52

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

相关标签:
8条回答
  • 2021-01-03 23:21

    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>
    
    0 讨论(0)
  • 2021-01-03 23:22

    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.

    0 讨论(0)
提交回复
热议问题