Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 861
Carsten Cors Avatar asked Dec 01 '25 00:12

Carsten Cors


1 Answers

The trouble had dissolved with the update 2 of Visual Studio 2015. At least the problem no longer consists, since installation of the update.

like image 183
Carsten Cors Avatar answered Dec 02 '25 12:12

Carsten Cors



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!