简体   繁体   中英

Visual Studio 2015 Blank App (Universal Windows): CS0731

I'm trying to create a project "Universal Windows". For this I have the Visual Studio 2015 Blank app (Universal Windows) used template.

I now get the following compilation error:

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

In the following source:

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);

be precise, the fault displayed for await path.GetFileAsync(filename) and await Windows.Storage.FileIO.ReadTextAsync(file).

The analysis of the error message Microsoft has not helped me: CS0731


Update

As to X of the error caused by faulty under load metadata. The type forwarder for type 'type' in assembly 'assembly' causes a cycle

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

Do I have reset the settings of the VS2015, by deleting the chache folder content and run devenv /resetuserdata .

Unfortunately, without success

Update 2

Still no solution, the file treatment corresponds to the Microsoft documentation, see https://msdn.microsoft.com/en-us/library/windows/apps/mt185401.aspx .

I here actually wanted to load sample data. But I have currently developed also the WebService for the provision of data. I let my sample data just about this WebService deploy. This is but I think no satisfactory solution.

麻烦已经解决了Visual Studio 2015的更新2。自安装更新以来,至少问题不再包括在内。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM