Closed belav closed 7 months ago
Some exceptions I saw around the time Rider finally hung for me
2023-11-18 10:28:21,937 [ 8786] WARN - #c.i.c.CSharpierLogger - Exception while running 'dotnet csharpier --version' in C:\Users\bela\AppData\Local\CSharpier\0.26.0
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "output" is null
at com.intellij.csharpier.CustomPathInstaller.ensureVersionInstalled(CustomPathInstaller.java:30)
at com.intellij.csharpier.CSharpierProcessProvider.setupCSharpierProcess(CSharpierProcessProvider.java:203)
at com.intellij.csharpier.CSharpierProcessProvider.findAndWarmProcess(CSharpierProcessProvider.java:92)
at com.intellij.csharpier.CSharpierProcessProvider.<init>(CSharpierProcessProvider.java:45)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
2023-11-18 10:28:21,930 [ 8779] SEVERE - #c.i.c.CSharpierLogger - Cannot run program "C:\Users\bela\AppData\Local\CSharpier\0.26.0\dotnet-csharpier" (in directory "C:\Users\bela\AppData\Local\CSharpier\0.26.0"): CreateProcess error=2, The system cannot find the file specified
java.lang.Throwable: Cannot run program "C:\Users\bela\AppData\Local\CSharpier\0.26.0\dotnet-csharpier" (in directory "C:\Users\bela\AppData\Local\CSharpier\0.26.0"): CreateProcess error=2, The system cannot find the file specified
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:370)
at com.intellij.csharpier.ProcessHelper.ExecuteCommand(ProcessHelper.java:53)
at com.intellij.csharpier.CustomPathInstaller.ensureVersionInstalled(CustomPathInstaller.java:26)
at com.intellij.csharpier.CSharpierProcessProvider.setupCSharpierProcess(CSharpierProcessProvider.java:203)
at com.intellij.csharpier.CSharpierProcessProvider.findAndWarmProcess(CSharpierProcessProvider.java:92)
at com.intellij.csharpier.CSharpierProcessProvider.<init>(CSharpierProcessProvider.java:45)
I also experience the issue with "System.UnauthorizedAccessException: Access to the path 'CSharpier.dll' is denied.".
When I open the first solution csharpier works fine, but i get this error as soon as I open a second solution. Formatting in the first solution still works fine.
I use visual studio 17.8.3 on windows and csharpier 0.26.5 installed globally.
Based on the problem with #989, it makes sense to add better error handling. The code in csharpier probably needs to use a try/catch around the call to format a file. If the work to get GRPC working is done, it would be easier to report the failure back to the extension.
Maybe it is also possible to detect the crashing/hung csharpier process better on the extension side. I can re-introduce the problem and try to come up with a better way to deal with a similar situation in the future.
C:\Users\bela\AppData\Local\Temp\SourceGeneratedDocuments\F4DCBEE912DC99E14C52B9BC\CSharpier.Tests.Generators\CSharpier.Tests.Generators.FormattingTestsGenerator