Open anatawa12 opened 1 year ago
The error message says because it is being used by another process.
however, this can be happened if file is opened for write access. The following is test code.
Test 1 - open as write first, then open as read
var path = @"C:\Users\anata\AppData\Local\VRChatCreatorCompanion\Repos\e9766711-7bb7-4b8f-bd00-3f06b8e1186c.json";
using (var stream1 = System.IO.File.OpenWrite(path))
{
Console.WriteLine("first stream opened.");
using (var stream2 = System.IO.File.OpenText(path))
{
Console.WriteLine("second stream opened.");
}
Console.WriteLine("second stream closed.");
}
Console.WriteLine("first stream closed");
PS C:\Users\anata\test> dotnet run
first stream opened.
Unhandled exception. System.IO.IOException: The process cannot access the file 'C:\Users\anata\AppData\Local\VRChatCreatorCompanion\Repos\e9766711-7bb7-4b8f-bd00-3f06b8e1186c.json' because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.File.OpenText(String path)
at Program.<Main>$(String[] args) in C:\Users\anata\test\Program.cs:line 6
Test 2 - Open as read first and then open as write
var path = @"C:\Users\anata\AppData\Local\VRChatCreatorCompanion\Repos\e9766711-7bb7-4b8f-bd00-3f06b8e1186c.json";
using (var stream1 = System.IO.File.OpenRead(path))
{
Console.WriteLine("first stream opened.");
using (var stream2 = System.IO.File.OpenWrite(path))
{
Console.WriteLine("second stream opened.");
}
Console.WriteLine("second stream closed.");
}
Console.WriteLine("first stream closed");
PS C:\Users\anata\test> dotnet run
first stream opened.
Unhandled exception. System.IO.IOException: The process cannot access the file 'C:\Users\anata\AppData\Local\VRChatCreatorCompanion\Repos\e9766711-7bb7-4b8f-bd00-3f06b8e1186c.json' because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.File.OpenWrite(String path)
at Program.<Main>$(String[] args) in C:\Users\anata\test\Program.cs:line 6
Describe the bug Frontend crashes unexpectedly.
To Reproduce Steps to reproduce the behavior: Sorry, I don't have exact steps but if I moved pages very quickly, frontend is likely to crash
Expected behavior Do not crash frontend at any time
Logs Errors from developer tool
Error log the time crashed
Desktop (please complete the following information):
Additional context No unity instances are launched. this measn there's no other processes for VPM.
Even if frontend doesn't crashes,
The process cannot access the file 'C:\Users\anata\AppData\Local\VRChatCreatorCompanion\Repos\ba28a4c3-fe97-45d3-b0ca-55c24e52ce3b.json' because it is being used by another process.
error is very likely to happens.I have many repositories. The following is settings.json