Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用GetStreamAsync获取RSS时不支持异常_C#_Silverlight_Windows Phone 8.1_Rss_Notsupportedexception - Fatal编程技术网

C# 使用GetStreamAsync获取RSS时不支持异常

C# 使用GetStreamAsync获取RSS时不支持异常,c#,silverlight,windows-phone-8.1,rss,notsupportedexception,C#,Silverlight,Windows Phone 8.1,Rss,Notsupportedexception,我正在Visual Studio 2015社区中编写RSS阅读器。我的项目在WindowsPhone8.1Silverlight中 我已按照上的说明进行操作 问题是,当项目即将在emulator上进行测试时,会向以下代码段抛出NotSupportedException: public async void LoadRss(string url) { HttpClient client = new HttpClient(); using (var stream = await cl

我正在Visual Studio 2015社区中编写RSS阅读器。我的项目在WindowsPhone8.1Silverlight中

我已按照上的说明进行操作

问题是,当项目即将在emulator上进行测试时,会向以下代码段抛出
NotSupportedException

public async void LoadRss(string url) {
    HttpClient client = new HttpClient();
    using (var stream = await client.GetStreamAsync(url))
    {
        XmlSerializer serializer = new XmlSerializer(typeof(Rss));
        this.Rss = serializer.Deserialize(stream) as Rss; //THE CURSOR POINTS HERE
        IsLoaded = true;
    }
}
例外情况:

System.Windows.ni.dll中出现“System.NotSupportedException”类型的异常,但未在用户代码中处理

附加信息:当 缓冲被禁用


有什么解决方法吗?

您可以尝试
Windows.Web.Http.HttpClient
Windows.Web.Syndication.SyndicationClient
Windows.Web.Http.HttpClient工作!谢谢@kiewic你应该把它作为答案贴出来。