2

I made ASP.NET application with MVC 5.1 technology and tried to deploy it on Winhost server. When I go to my web site, I get the following error message.

Could not load file or assembly 'System.Web.Mvc, Version=5.1.0.0, 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)

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.3400

FIXED: Problem was been in root folder web.config file and in local web.config too. We needed to add MVC assembly.

<system.web>
<trust level="Full"/>
<customErrors mode="Off"/>
<authentication mode="None"/>
<httpRuntime targetFramework="4.5" requestValidationMode="2.0" maxRequestLength="65536"/>
<compilation targetFramework="4.5" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true" debug="true">
  <assemblies>
    <add assembly="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
  </assemblies>
</compilation>

orthodox4ever
  • 21
  • 1
  • 4
  • Please install .Net Framework 4.5. See also [this post][1]. [1]: http://stackoverflow.com/questions/20385785/can-i-run-mvc-5-application-on-net-framework-4-0 – Christiaan van Bergen Jun 04 '14 at 08:28
  • @ChristiaanvanBergen - WinHost is a shared hosting with .NET 4.5.1 already installed. – Davor Jun 04 '14 at 08:38

1 Answers1

1

If you have .Net 4.5 already installed then this post might give you the right answer. Just copy/publish the needed assemblies to the bin folder. The article written years ago by Phil Haack is still valid as far as I know.