c# version=22.214.171.124 download - Could not load file or assembly 'System.Net.Http.Formatting' or one of its dependencies. The system cannot find the path specified
I have a small MVC app that I use for practice reasons, but now I am encountering an error every time I try to debug:
Could not load file or assembly 'System.Net.Http.Formatting' or one of its dependencies. The system cannot find the path specified.
I've googled but cannot find a solution. I'm using .NET 4.5.
It can't be the DLL file because I'm using .Net 4.5.
Removing the following lines from
web.config solved my problem. Note that in this project I didn't use WebApi components. So for others this solution may not work as expected.
<dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-126.96.36.199" newVersion="188.8.131.52" /> </dependentAssembly>
As originally suggested in a comment by GeoMac and documented on NuGet's docs the following worked for me when none of the other answers worked:
Tools / NuGet Package Manager / Package Manager Console
Update-Package -ProjectName MyProjectName -reinstall
In my case none of the above solutions worked. I solved by right clicking on the reference
from Visual studio and setting the property Copy Local to true.
I hope this is useful somehow.
What solved this annoying error for me was just to close Visual Studio and open it again. Then rebuild the solution, and it all worked again. Sorry for the crap answer, but I think it's worth an answer because it solved it for me.
In my case, none of the above worked, however, replacing 184.108.40.206 with 220.127.116.11 did solve the problem.