-
-
Notifications
You must be signed in to change notification settings - Fork 89
-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rider plugin does not reformat .cs files #888
Comments
Could you check the rider logs too see what kind of CSharpier logging occurs when Rider starts? I'm thinking something is failing earlier and it leaves CSharpier in a non-working state which throws this exception. Enabling the debug logging will give more info. |
Thanks. I did that and I believe I found the issue. I will attempt to install .NET version 6 to see if that resolves the problem, but is this an expected requirement and would it be possible to list it as a dependency somehow so that Rider knows to automatically install it?
|
I confirmed that installing the .NET 6 runtime from https://dotnet.microsoft.com/en-us/download/dotnet/6.0 resolved my issue. I will resolve the ticket if you don't think there is a way to have Rider automatically install the correct dependencies when installing the csharpier plugin. With .NET version 7 available now, I just hadn't needed to install the previous version until this plugin so it wasnt installed. |
I'm not sure if I can get Rider to install dotnet, but I can at least modify the plugin to handle this and display an error letting the user what is happening. I'll use this issue to keep track of doing that. If you update to the latest version of CSharpier, it does target net6 or net7 so you'd no longer need net6 installed. |
In case this may help anyone . I had very similar issues - CSharpier Rider plugin could not format files and I had errors similar to the ones described above. In my case issue was caused by a non-standard .NET install location. I prefer to install .NET using dotnet-install script, and have it installed into Most of the things work just fine - building from commandline, Rider, VSCode all good with this setup. But there seems to be something wrong with the dotnet tools. I could run csharpier from command line via
but I could not run
Same problem with other tools, so it is not csharpier-specific. In my case fix was to specify location of my .NET installation in
After I did that, both |
Woohoo! Thank you, @iblazhko! In my case (MacOS), I even had to change |
The changes to the rider plugin for 1.6.1 in #1190 have better support for dotnet commands and finding the dotnet installation. It will be available in a day or two. |
I have installed version 1.3.7 of the plugin and upon saving any .cs file in Rider, the error below generates and the file is not formatted. This error also generates if I manually initiate a format through the "Reformat with CSharpier" action in the Rider action menu.
Exception in plugin CSharpier (1.3.7)
The text was updated successfully, but these errors were encountered: