c# - Visual Studio 2015 空白应用程序(通用 Windows): CS0731

标签 c# asynchronous visual-studio-2015

我正在尝试创建一个项目“通用 Windows”。为此,我使用了 Visual Studio 2015 Blank app (Universal Windows) 模板。

我现在得到以下编译错误:

CS0731 The type forwarder for type 'Windows.Foundation.IAsyncOperation`1' in assembly 'Windows' causes a cycle

来源如下:

string filename = "SampelData.json";
var path = Windows.ApplicationModel.Package.Current.InstalledLocation;
Windows.Storage.StorageFile file =  await path.GetFileAsync(filename);                   
string jsonResult = await Windows.Storage.FileIO.ReadTextAsync(file);

准确地说,错误显示为 await path.GetFileAsync(filename)await Windows.Storage.FileIO.ReadTextAsync(file).

错误信息微软没有帮我分析: CS0731


更新

至于负载元数据错误导致的错误X。程序集“assembly”中类型“type”的类型转发器导致循环

This error can only occur with improperly formed imported metadata. It cannot occur with only C# source.

我是否通过删除 chache 文件夹内容并运行 devenv/resetuserdata 重置了 VS2015 的设置。

很遗憾,没有成功

更新 2

还是没有解决,文件处理对应微软文档,见https://msdn.microsoft.com/en-us/library/windows/apps/mt185401.aspx .

我在这里实际上是想加载样本数据。但我目前还开发了用于提供数据的 WebService。我让我的样本数据只是关于这个 WebService 部署。这是但我认为没有令人满意的解决方案。

最佳答案

问题已通过 Visual Studio 2015 的更新 2 解决。至少问题不再存在,因为安装了更新。

关于c# - Visual Studio 2015 空白应用程序(通用 Windows): CS0731,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35453854/

相关文章:

visual-studio-2015 - Visual Studio 2015 发布 WebJobs 问题

visual-studio - 查找结果不显示结果

javascript - 在 Visual Studio 2015 + Node.js 中显示 JavaScript 文件的导航栏

c# - AutoMapper - 将 Json 字符串属性映射到基于接口(interface)的对象

c# - Service Fabric - 远程监听器和通信监听器不同时工作

javascript - 每次在 GridView 中单击按钮或链接时如何打开不同的新弹出窗口

python - 在 Django 中启动后台任务的简单方法

c# - 基于等待任务的队列

c# - .net 2.0 及更高版本中的算术溢出异常

javascript - 在for循环中调用异步函数