Archimede
Archimede

Reputation: 727

windows phone 8.1 RT error with files creation

in according to this tutorial: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh758325.aspx?f=255&MSPPError=-2147217396

I've written the following function:

private async void WriteToFile()
{
   StorageFolder folder =
   Windows.Storage.ApplicationData.Current.LocalFolder;
   StorageFile sampleFile =
   await folder.CreateFileAsync("sample.txt", CreationCollisionOption.ReplaceExisting);
}

But, if I run it, I see the following error:

Exception thrown: 'System.ArgumentException' in mscorlib.ni.dll
Use of undefined keyword value 1 for event TaskScheduled.

Why? How can I solve this issue?

Upvotes: 0

Views: 107

Answers (1)

Jigs257
Jigs257

Reputation: 14

Its giving error like "Additional information: Use of undefined keyword value 1 for event TaskScheduled" So may be sample.txt can't able to define as its undefined keyword.

Change file name to other name or "sample1.txt", it will work.

private async void WriteToFile()
{
   StorageFolder folder =
   Windows.Storage.ApplicationData.Current.LocalFolder;
   StorageFile sampleFile =
   await folder.CreateFileAsync("sample1.txt", CreationCollisionOption.ReplaceExisting);
}

Upvotes: 0

Related Questions