Skip to main content

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

#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>