4

We're evaluating a vanilla install of Sitecore 8.2 (via the .zip file rather than the .exe) and we're now coming across a assembly reference mismatch when loading the site.

Server Error in '/' Application.

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I've checked the version of System.Web.Mvc in the bin folder (which is 5.2.30128.0) and scoured for any references to version 3.0.0.1 of Sytem.Web.Mvc in various config files but to no avail.

Any ideas what is causing the lookup for this particular version?

2
  • Can you please check in the web.config if the version of System.Web.MVC is 5.2.3.0?
    – adarsh
    Oct 26 '17 at 11:38
  • 2
    Have you deployed any code to it at all? It sounds like a web.config got deployed that references MVC 3.0. Just take the web.config from the zip file and overwrite the one in the website.
    – Chris Auer
    Oct 26 '17 at 12:48
2

In your web.config file in your website root, you should have the following tag as a direct child of the <configuration> tag:

<compilation defaultLanguage="c#" debug="false" targetFramework="4.5.2">
   <assemblies>
   </assemblies>
</compilation>

Inside of the assemblies tag, there should be the following add tag:

<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />

Also, your web.config in the site root should have the following tag as a direct child of the <configuration> tag:

<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
   </assemblyBinding>
</runtime>

Inside of the assembly binding tag, there should be the following dependentAssembly tag:

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

If all of this is in place with the correct version numbers, then you should be in good shape.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.