Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
427 views
in Technique[技术] by (71.8m points)

c# - Could not load file or assembly 'System.Net.Http' or one of its dependencies

Maybe Relevant information: I have a web application I built with .net 4.5. I wanted to deploy to Azure's Web Sites but it only supports .net 4.0 so I downgraded the project to .net 4.0. It still works when run locally.

When I publish to Azure, i get this error:

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

I have tried removing the Web API with nuget and readding it, as another question on SO suggested but I still have the same problem.
I have tried close/open VS, and clean/build.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I solved a similar problem (System.Web.Http and System.Net.Http.Formatting) error by removing the reference to problem reference (which was pointed to my .Net installation folder) and replacing it with the reference file in my packages folder that was installed by the Microsoft.AspNet.WebApi NuGet package.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...