Skip to content
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

VSCode keep saying CSharpier need to be installed #978

Closed
WegPast opened this issue Oct 26, 2023 · 4 comments
Closed

VSCode keep saying CSharpier need to be installed #978

WegPast opened this issue Oct 26, 2023 · 4 comments

Comments

@WegPast
Copy link

WegPast commented Oct 26, 2023

Hi
I recently update VSCode to 1.83 and since then I can't use CSharpier because I have this error showing :
CSharpier needs to be installed to support formatting files

I searched the internet and tried several solutions like deleting cache folder, reinstalling VSCode and CSharpier extension but no luck. I also looked on #790 but VSCode is a bit different than Visual Studio and suggested commands where not able to run...

Here is my VSCode information :

Version: 1.83.1 (user setup)
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

And running the v1.3.6 CSharpier extension ( or at least, was running it :p )

Any suggestions to diagnose what's wrong?

image

@belav
Copy link
Owner

belav commented Oct 28, 2023

I've seen this happen when the command to try to find the version of csharpier fails because dotnet is not in the path. It is odd that this used to work for you and now stopped. The output window will hopefully show you what happens when it tries to run dotnet csharpier --version

There are comments on a few issues that have fixes for this, but I am failing to find them right now. This is semi-related - #893 but I don't know if it directly applies to you.

image

@WegPast
Copy link
Author

WegPast commented Oct 30, 2023

Allright, so what can I do to help find a solution ? Any debug/log/command to do ?
By the way, to be clearer, I updated VScode from 1.7 to 1.83 before this problem happened... (If it really necessary I can try to downgrade VScode and test again but if we can skip this action ^^')

Here is the dotnet csharpier --version command result by the way. I ran it outside my project because it was telling me that there were multiple project in it (wtf...) so it's executed in the parent folder :

> dotnet csharpier --version
You must install or update .NET to run this application.

App: C:\Users\WegPast\.dotnet\tools\dotnet-csharpier.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: C:\Program Files\dotnet\

The following frameworks were found:
  7.0.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=win10-x64```

@belav
Copy link
Owner

belav commented Nov 1, 2023

I haven't seen this before, but I believe it is the runtime for dotnet and not the sdk

The following frameworks were found:
  7.0.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

If I run dotnet --list-sdks this is what I get. And I believe for running dotnet tools you need to have the sdks installed. The documentation for dotnet tools isn't clear on that.

7.0.403 [C:\Program Files\dotnet\sdk]
8.0.100-rc.2.23502.2 [C:\Program Files\dotnet\sdk]

Can you try installing the net7 sdk from here and see if that works? https://dotnet.microsoft.com/en-us/download/dotnet/7.0

@WegPast
Copy link
Author

WegPast commented Nov 1, 2023

Ok so there no more error message now.
You were right I needed to install the sdk not the runtime.
But note that I needed to install .NET SDK 6 in order to make it work. With 7 the message was still there.
Now I need to figure out why it'does not take my ".editorconfig" in account (I want those damn curly brackets on the same line x) )

Thanks for you help :)

@WegPast WegPast closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants