开发者

Not able to load Microsoft.Http dll in ASP.NET MVC3 application at runtime

开发者 https://www.devze.com 2023-04-09 00:33 出处:网络
I created a WCF service and exposed it as REST service. I am trying to consume this service from ASP.Net MVC3 applic开发者_JAVA百科ation.

I created a WCF service and exposed it as REST service. I am trying to consume this service from ASP.Net MVC3 applic开发者_JAVA百科ation.

I added a reference to Microsoft.Http dll, to use HttpClient and get the response from a POST method of REST service, as in the code below -

string uri = http://localhost:12958/Host1/RestService.svc/SubmitAdvisor;

using (HttpResponseMessage response = new HttpClient().Post(uri, HttpContentExtensions.CreateDataContract(obj)))

{

};

I get the follwing error at runtime -

Could not load file or assembly 'Microsoft.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

What is it I am missing?


Download from this link http://aspnet.codeplex.com/releases/view/24644 After,

Microsoft.Http.dll's location is like this

C:\Program Files (x86)\Microsoft WCF REST\WCF REST Starter Kit Preview 2\Assemblies

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号