3

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> 

2
  • Please install .Net Framework 4.5. See also [this post][1]. [1]: stackoverflow.com/questions/20385785/… Commented Jun 4, 2014 at 8:28
  • @ChristiaanvanBergen - WinHost is a shared hosting with .NET 4.5.1 already installed. Commented Jun 4, 2014 at 8:38

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.