0

I have WebApi controller which is working correctly and I can send requests using postman or anything else.

But when I send requests locally I get an error and when I'm trying to reach the endpoint I get an error:

Could not load file or assembly 'System.Net.Http.Formatting' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I've updated all the Nuget packages so all the projects have the same version.

I tried to delete package folder and restore all packages.

I tried to reinstal Microsoft.AspNet.WebApi for solution.

Nothing helped.

Rio
  • 35
  • 8

2 Answers2

0

Have you tried this, Stackoverflow Questions

Run below command at NuGet Package manager to correct broken dependency

Update-Package Microsoft.AspNet.WebApi -reinstall
Community
  • 1
  • 1
alphacoder
  • 553
  • 2
  • 9
  • 21
0

If you are debugging the application in Visual Studio, try deleting bin and obj folders before starting up.

I had similar situation, though in my case the runtime exceptions were thrown on application startup.

Neither reinstallation nor restoration of NuGet packages would help me as well.

zen
  • 353
  • 2
  • 12