You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
We are seeing the following issue with our UWP application suspends on some machines
D:\a\1\s\Xamarin.Forms.Platform.UAP\WindowsSerializer.cs at 48, line 4
System.IO.FileLoadException: The process cannot access the file because it is being used by another process. The file is in use. Please close the file before continuing.
Seem like the following line
StorageFile file = await ApplicationData.Current.RoamingFolder.CreateFileAsync(PropertyStoreFile, CreationCollisionOption.ReplaceExisting).DontSync();
is causing the issue.
It seems that it is possible to have 2 of the same applications running at the same time, thus if they both go to sleep the above line should fail. One suggestion is to have a try catch around the CreateFileAsync, if fails with the other process, then open the file and do what is needed.
This has been an issue since xamarin.forms 4.2 but is not showing up a lot with more usage of our system.
The text was updated successfully, but these errors were encountered:
Here is a sample program to show the error. This just a xamarin.forms sample project that i enabled multi instance.
Deploy the project, then start up 3 or more instances of the program. On the main window you will see the button suspend app. Click that, one or more of the apps will fault and disappear. Hope this helps, i made a private version with the above changes and it seems to resolve the issue for me
We are seeing the following issue with our UWP application suspends on some machines
D:\a\1\s\Xamarin.Forms.Platform.UAP\WindowsSerializer.cs at 48, line 4
System.IO.FileLoadException: The process cannot access the file because it is being used by another process. The file is in use. Please close the file before continuing.
Seem like the following line
StorageFile file = await ApplicationData.Current.RoamingFolder.CreateFileAsync(PropertyStoreFile, CreationCollisionOption.ReplaceExisting).DontSync();
is causing the issue.
It seems that it is possible to have 2 of the same applications running at the same time, thus if they both go to sleep the above line should fail. One suggestion is to have a try catch around the CreateFileAsync, if fails with the other process, then open the file and do what is needed.
This has been an issue since xamarin.forms 4.2 but is not showing up a lot with more usage of our system.
The text was updated successfully, but these errors were encountered: