csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

VS 2019 extension erroneously calls csharpier --server

Open jamesshenry opened this issue 3 months ago • 1 comments

Environments

  • IDE Version: VS 2019
  • Extension Version: 2.0.3
  • CSharpier Version: 0.30.6/1.1.2 will NOT be the same as the extension version
  • Operating System: Windows 11
  • .csharpierrc Settings: N/A
  • .editorconfig Settings: N/A

Log Output

[Info - 02/10/2025 16:11:14] Starting
[Debug - 02/10/2025 16:11:14] CSharpier.InstallerWarningShown was True
[Debug - 02/10/2025 16:11:23] Trying to find - C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties\AssemblyInfo.cs
[Debug - 02/10/2025 16:11:23] Ensure there is a csharpier process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties
[Debug - 02/10/2025 16:11:23] Looking for csproj in or above C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties that references CSharpier.MsBuild
[Debug - 02/10/2025 16:11:24] Running 'dotnet tool list' to look for version
[Debug - 02/10/2025 16:11:24] Output was: 
 Package Id      Version      Commands      Manifest
---------------------------------------------------
[Debug - 02/10/2025 16:11:24] Running 'dotnet tool list-g' to look for version
[Debug - 02/10/2025 16:11:24] Output was: 
 Package Id      Version      Commands 
--------------------------------------
csharpier       1.1.2        csharpier
[Debug - 02/10/2025 16:11:24] Using 1.1.2 as the version number.
[Debug - 02/10/2025 16:11:33] C:\Users\henryj\AppData\Local\CSharpier\1.1.2\csharpier --version output: 1.1.2
[Debug - 02/10/2025 16:11:33] Using 1.1.2 as the version number.
[Debug - 02/10/2025 16:11:33] CSharpier at C:\Users\henryj\AppData\Local\CSharpier\1.1.2 already exists
[Debug - 02/10/2025 16:11:33] Adding new version 1.1.2 process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties
[Debug - 02/10/2025 16:11:33] Running C:\Users\henryj\AppData\Local\CSharpier\1.1.2\csharpier --server
[Warn - 02/10/2025 16:11:36] Spawning the csharpier server timed out.

[Debug - 02/10/2025 16:11:36] Trying to find - C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties\AssemblyInfo.cs
[Debug - 02/10/2025 16:11:36] Ensure there is a csharpier process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties
[Debug - 02/10/2025 16:11:36] Trying to find - C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties\AssemblyInfo.cs
[Debug - 02/10/2025 16:11:36] Ensure there is a csharpier process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties
[Debug - 02/10/2025 16:14:05] Trying to find - C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties\AssemblyInfo.cs
[Debug - 02/10/2025 16:14:05] Ensure there is a csharpier process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties
[Debug - 02/10/2025 16:30:14] Trying to find - C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties\AssemblyInfo.cs
[Debug - 02/10/2025 16:30:14] Ensure there is a csharpier process for C:\source\devops\OnPrem.MasterData\src\AddressManagementModule\Properties

Steps to reproduce

  1. Install extension
  2. Run dotnet tool install -g csharpier or dotnet tool install -g csharpier --version 0.30.6
  3. Run "Format with CSharpier"

Expected behavior

Should format the open cs file

Actual behavior

Image

jamesshenry avatar Oct 02 '25 15:10 jamesshenry

The easiest fix is to use Disable CSharpier Server option - https://csharpier.com/docs/EditorsTroubleshooting#known-issues

There are logs written by the server that may help figure out why the server process can't be started, but at the moment they are a bit buried. The path would be something like below.

C:\Users\henryj\AppData\Local\CSharpier\1.1.2\.store\csharpier\1.1.2\csharpier\1.1.2\tools\net8.0\any\server.log

belav avatar Oct 02 '25 16:10 belav