4

I follow Could not load file or assembly System.Net.Http, Version=4.0.0.0 with ASP.NET (MVC 4) Web API OData Prerelease

I follow your proposal steps. I use Unity. and I obtain an issue on the Boostrapper.Initialize. This issue says "An exception of type 'System.IO.FileLoadException' occurred in SupportCours2.dll but was not handled in user code

Additional information:

Could not load file or assembly 'System.Web.Http, Version=5.0.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)" and in the inner I have {"Could not load file or assembly 'System.Web.Http, Version=4.0.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)":"System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"} 

It's weird version 4.0 for the inner and for the top it's the 5.0

I try many things : I follow the upprade http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 and Where can I find a NuGet package for upgrading to System.Web.Http v5.0.0.0? and Could not load file or assembly System.Net.Http, Version=4.0.0.0 with ASP.NET (MVC 4) Web API OData Prerelease

I follow also your proposals by using the "pre" version and modify the web.config. I didn't work.

Can you help?

best regards, Alexandre

Community
  • 1
  • 1
user2416437
  • 121
  • 2
  • 11

4 Answers4

3

this one is worked for me: write on "package manager console"

Update-Package Microsoft.AspNet.WebApi -reinstall
torun
  • 437
  • 1
  • 5
  • 11
0

Following NuGet Package worked for me,

`Install-Package Microsoft.AspNet.WebApi -Version 5.0.0`
Jatin patil
  • 4,140
  • 1
  • 15
  • 27
0

It may be a simple issue just that the dll files are not copied to your built 'bin' folder.

Reference: https://msdn.microsoft.com/zh-tw/library/t1zz5y8c(v=vs.100).aspx

Paul Floyd
  • 3,765
  • 5
  • 25
  • 37
Johnny Kuo
  • 71
  • 1
  • 7
0

When you update the configuration file need to save as configuration file type

Ganesha
  • 302
  • 1
  • 3
  • 7