Why can't I use "Reformat with CSharpier" in Visual studio 2022?
It is unclickable
It doesn't work. When I set "Reformat with CSharpier on Save"
This are my version CSharpier globally version 0.26.6 Visual Studio CSharpier extension version 1.4.8 Visual Studio 2022 version 17.8.3
I found the log: OnBeforeSave Before format Skipping formatting because process does not support formatting. Done Format
Thanks.
Can confirm this issue, moreover this issue also rise if you install Resharper after this, somehow option is missing completely
Anyway if you get this issue, uninstall the extension, manually download tool to global
dotnet tool install -g csharpier #verify you don't have charpier, if you've already had, skip this
Then install this extension and it should work out again
The message "Skipping formatting because process does not support formatting." indicates that the extension was unable to get csharpier running in the background. I haven't had a chance to update VS yet to add more helpful logging, but these Troubleshooting Steps should help figure out why the extension is unable to run CSharpier.
I've run into the same problem.
Uninstall the tool globally and the extension.
Folder looks like:
dotnet csharpier --version
dotnet : Could not execute because the specified command or file was not found.
Install: dotnet tool install csharpier -g
Tool 'csharpier' (version '0.26.7') was successfully installed. PM> dotnet csharpier --version 0.26.7+c8aec144f227bda8cf195011e9d91bb36c33337f
Folder remains unchanged but version has id suffix.
Install extension. Launch VS2022.
PM> dotnet csharpier --version
0.26.7+c8aec144f227bda8cf195011e9d91bb36c33337f
[Debug - 12/19/2023 12:40:26 PM] Unable to find dotnet-tools.json, falling back to running dotnet csharpier --version [Debug - 12/19/2023 12:40:27 PM] dotnet csharpier --version output: [Debug - 12/19/2023 12:40:27 PM] Using as the version number. [Warn - 12/19/2023 12:40:27 PM] CSharpier was not found so files may not be formatted.
So probably the issue is the version includes the id but the folder doesn't. I'll delete all folders after uninstall for csharpier and retry.
EDIT: Not sure if relevant but a different solution I may have clicked "install locally" instead of globally. I wonder if that could cause this issue.
EDIT 2: Followed the steps from the provided troubleshooting guide. Uninstall tool, extension, delete folder in appData.
PM> dotnet tool install csharpier --version 0.26.7 --tool-path "not actual path\local\CSharpier\0.26.7" PM> dotnet csharpier --version 0.26.7+c8aec144f227bda8cf195011e9d91bb36c33337f
But this still didn't resolve the issue.
I tried renaming the folder to include the id but this doesn't work either.
[Debug - 12/19/2023 12:56:42 PM] Unable to find dotnet-tools.json, falling back to running dotnet csharpier --version [Debug - 12/19/2023 12:56:42 PM] dotnet csharpier --version output: [Debug - 12/19/2023 12:56:42 PM] Using as the version number. [Warn - 12/19/2023 12:56:42 PM] CSharpier was not found so files may not be formatted.
EDIT 3: If I click "install globally" warning from vs2022 I get this in the CSharpier output:
[Debug - 12/19/2023 1:03:09 PM] Installing CSharpier globally [Debug - 12/19/2023 1:03:09 PM] Tool 'csharpier' is already installed. [Debug - 12/19/2023 1:03:09 PM] disposing of process for version null
EDIT 4: Today (after a computer shutdown) I opened another solution and the problem is gone.
[Debug - 12/20/2023 11:15:05 AM] Unable to find dotnet-tools.json, falling back to running dotnet csharpier --version [Debug - 12/20/2023 11:15:07 AM] dotnet csharpier --version output: 0.26.7+c8aec144f227bda8cf195011e9d91bb36c33337f [Debug - 12/20/2023 11:15:07 AM] Using 0.26.7 as the version number. [Debug - 12/20/2023 11:15:07 AM] dotnet csharpier --version output: 0.26.7+c8aec144f227bda8cf195011e9d91bb36c33337f [Debug - 12/20/2023 11:15:07 AM] Using 0.26.7 as the version number. [Debug - 12/20/2023 11:15:07 AM] CSharpier at C:\Users<redacted>\AppData\Local\CSharpier\0.26.7 already exists [Debug - 12/20/2023 11:15:07 AM] Adding new version 0.26.7 process for
[Debug - 12/20/2023 11:15:07 AM] Warm CSharpier with initial format