ant*_*eys 5 c# http visual-studio-2012 windows-phone-8
我对WP8开发相对较新,并且遇到了一个我无法弄清楚的问题,即使经过数小时的谷歌搜索.
我正在使用visual studio 2012并使用NuGet实现了System.Net.Http,检查了引用,copy local设置为true,但它不会构建.
这是一个问候我的错误信息:
CA0001 Error Running Code Analysis CA0001 : The following error was encountered while reading module '3D Protect Premium': Could not resolve member reference: [System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]System.Net.Http.HttpClient::PostAsync. [Errors and Warnings] (Global)
Run Code Online (Sandbox Code Playgroud)
我如何解决这个问题,所以引用的版本是正确的?
编辑
代码在下面添加.这似乎不成问题,它只是引用 - 我认为我的误解是诚实的,我只是不知道什么是System.Net.Http汇编!
//Creates a new HttpClient Instance
var client = new HttpClient();
// This is the postdata
// Data forms an array and is used to populate the remote MySQL DB
var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("name", "windowsphonetest"));
postData.Add(new KeyValuePair<string, string>("latitude", LatitudeString));
postData.Add(new KeyValuePair<string, string>("longitude ", LongitudeString));
postData.Add(new KeyValuePair<string, string>("devID", "test"));
HttpContent content = new FormUrlEncodedContent(postData);
//The actual HTTP Transaction
client.PostAsync("http://blah.com", content).ContinueWith(
(postTask) =>
{
postTask.Result.EnsureSuccessStatusCode();
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2985 次 |
最近记录: |