Could not load file or assembly 'System.Web.Mvc(1)' or one of its dependencies

0

The following error appeared after deploying the application to IIS, although it's NOT the first time to deploy this web application, but this is a new update to it!

Could not load file or assembly 'System.Web.Mvc(1)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

enter image description here

c#
asp.net-mvc
iis
asked on Stack Overflow Aug 27, 2019 by Angelos M Reda

1 Answer

1

It looks like you tried to install the ASP.NET MVC dependency twice since you have System.Web.Mvc(1) instead of plain System.Web.Mvc, so please take note of that. More than likely, that other assembly you are using is referencing the old dll, so make sure you have the right newVersion value under BindingRedirect in your Web.config file, as it should look something like this:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
      <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
answered on Stack Overflow Aug 27, 2019 by Max Voisard • edited Aug 27, 2019 by Max Voisard

User contributions licensed under CC BY-SA 3.0