Troubleshooting
The editor extensions run CSharpier to facilitate format files.
CSharpier is kept running to speed up formatting results.
The extensions install CSharpier to a custom path to avoid commands like dotnet tool update -g csharpier
failing because a CSharpier is running.
When the extension is unable to format files, it is generally a problem with being unable to install or execute the extension. You can use the information from the logs it outputs to understand the failure and then attempt the troubleshooting steps below.
Enabling Debug Logs
VisualStudio
- Navigate to
Tools - Options - CSharpier
- Change
Log Debug Messages
totrue
VSCode
- Navigate to
File - Preferences - Settings - Extensions - CSharpier
- Check
Enable debug logs
- Restart VSCode
Rider
- Execute the action
Debug Log Settings
- Add an entry for
#com.intellij.csharpier.CSharpierLogger
- Restart Rider
Locating Logs
Visual Studio
- Navigate to
View - Output
- Change the
Show output from:
dropdown toCSharpier
VSCode
- Navigate to
View - Output
- Change the dropdown to
CSharpier
Rider
- Execute the action
Show Log in Explorer
- Look for lines that contain
#c.i.c.CSharpierLogger
Troubleshooting Steps
The following can help track down issues with the extension being unable to install/run CSharpier
- Validate the following command can run in the directory of your project
dotnet csharpier --version
- If the extension was able to install CSharpier it should exist at a path such as
C:\Users\[UserName]\AppData\Local\CSharpier\[CSharpierVersion]
or
$HOME/.cache/csharpier/[CSharpierVersion]
- Assuming the directory above exists, attempt to run the following in that directory
dotnet csharpier --version
- If the installation appears to be corrupt, delete the directory and install CSharpier there yourself
dotnet tool install csharpier --version [CSharpierVersion] --tool-path [PathFromStep2]
- Repeat step 3 to validate the install