Back to Devexpress

Could not load file or assembly System.Web.Mvc or one of its dependencies

aspnetmvc-404543-troubleshooting-installation-and-update-issues-could-not-load-file-or-assembly-system-web-mvc.md

latest768 B
Original Source

Could not load file or assembly System.Web.Mvc or one of its dependencies

  • Sep 02, 2023

Error Description

This error can occur after an MVC version has been updated and the System.Web.Mvc assembly version is changed as a result. Thus, an MVC project can’t locate the System.Web.Mvc assembly that it references.

Solution

Modify the web.config file to redirect the System.Web.Mvc assembly to the version installed on your machine.

xml
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
    </dependentAssembly>
    ...
</assemblyBinding>