我正在尝试创建一个项目“通用 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/