无法在运行时在 ASP.NET MVC3 应用程序中加载 Microsoft.Http dll
我创建了一个 WCF 服务并将其公开为 REST 服务。我正在尝试从 ASP.Net MVC3 应用程序使用此服务。
我添加了对 Microsoft.Http dll 的引用,以使用 HttpClient 并从 REST 服务的 POST 方法获取响应,如下面的代码所示 -
string uri = http://localhost:12958/Host1/RestService.svc/SubmitAdvisor;
using (HttpResponseMessage response = new HttpClient().Post(uri, HttpContentExtensions.CreateDataContract(obj)))
{
};
我在运行时收到以下错误 -
无法加载文件或程序集“Microsoft.Http,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。系统找不到指定的文件。
我缺少什么?
I created a WCF service and exposed it as REST service. I am trying to consume this service from ASP.Net MVC3 application.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从此链接下载 http://aspnet.codeplex.com/releases/view/24644
之后,
Microsoft.Http.dll的位置是这样的
Download from this link http://aspnet.codeplex.com/releases/view/24644
After,
Microsoft.Http.dll's location is like this