Exception while reading text from file using FileIO.ReadTextAsync

I get the following exception when trying to read the locl text file with

var text = await FileIO.ReadTextAsync(file); 

The handle this oplock was connected to was closed. oplock is now broken. (Exception from HRESULT: 0x80070323)

This happens in one of the regression modulation tests, from time to time it happens in the application. XAML + C # Application

Any ideas that might be causing this ?!

+8
c # windows-store-apps windows-runtime
source share
1 answer

I had the same problem that occurred when matching threads. I tried to use the same file at the same time in two places and did not understand this.

Try to confirm that your code is looking for some other access to the same file and checks if you are closed after reading it, and do not forget to call "wait" or use a lock in each reading of the file. I think this may solve your problem.

+5
source share

All Articles