Open Od1Um opened 3 years ago
Experiencing same issue Okay so uninstalling and reinstalling the csharp addon fixes it
Reinstalling did not fix the issue for me.
@Od1Um Is "editor.defaultFormatter": "ms-dotnettools.csharp",
necessary? In my experience when I am working from a C# workspace it uses C# formatter as expected.
Reinstalling did not fix the issue for me.
same here after clean install, neither reinstall nor @JoeRobich setting does work. Ctrl-I shows dialog with no formatter installed for 'csharp' files with buttons install formatter and cancel.
update: apparently omnisharp does not run and I'm unable to start it with Ctrl-Shift-P Omnisharp Restart update: omnisharp restarts fine, I have 2 csprojects (one git submodule) of which I have to select one, this wasn't the case earlier. Works fine with this workaround.
@Od1Um I see the following in your omnisharp log
System.IO.FileNotFoundException: P:\Development\Visual Studio 2019\MSBuild\Current\Bin\Microsoft.Build.dll
Do you have an incomplete install of VS on your system? Might try a repair.
I installed this extension and VSCode doesn't recognize it as a csharp formatter. Searching on the marketplace for category:formatters csharp
does not list this extension. Setting "editor.defaultFormatter": "ms-dotnettools.csharp" and formatting with shift+alt+F says the same thing, "Extension C# cannot format (filename).cs"
I eventually got it working by simply saving with "format on save" enabled. After this, now shift+alt+F formats properly, whereas before it said there was no formatter.
I had this problem this morning and tried everything listed above. Adding "editor.defaultFormatter": "ms-dotnettools.csharp" explicitly to my settings seems to have fixed it. Not really sure why it broke but it was working as expected in prior days.
Tried all of the above. Added "editor.defaultFormatter": "ms-dotnettools.csharp" and checked all "format on ...". shift + alt + f still says "There is no formatter for csharp files installed". Installed OmniSharp because it was recommended and from Microsoft. Installed dotnet sdk, even though will never use it, just to maybe get indented c# code. Refusing to need an extension for indenting the code. Mad.
Issue Description
The formatter stopped working in one of the launches. Yesterday everything worked and the code was formatted, today VS Code gives an error: csharp formatter not installed
Settings jsom
Expected Behavior
Actual Behavior
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.58.2 C# Extension: 1.23.13
Dotnet Information
����� SDK ��� .NET (��ࠦ��騩 �� global.json): Version: 5.0.302 Commit: c005824e35 �।� �믮������: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.302\ Host (useful for support): Version: 5.0.8 Commit: 35964c9215 .NET SDKs installed: 5.0.302 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |auto-using|Fudge|0.7.15| |better-comments|aaron-bond|2.1.0| |bracket-pair-colorizer|CoenraadS|1.0.61| |change-case|wmaurer|1.0.0| |code-spell-checker|streetsidesoftware|1.10.2| |code-spell-checker-russian|streetsidesoftware|0.2.10| |csharp|ms-dotnettools|1.23.13| |csharpsortusings|jongrant|0.0.3| |docomment|k--kato|0.1.20| |eppz-code|eppz|1.2.52| |material-icon-theme|PKief|4.8.0| |material-theme|zhuangtongfa|3.11.1| |namespace|adrianwilczynski|1.1.2| |night-owl|sdras|2.0.1| |one-dark-theme|mskelton|1.9.0| |shader|slevesque|1.1.5| |shaderlabvscodefree|amlovey|1.2.8| |theme-cobalt2|wesbos|2.2.5| |theme-dracula|dracula-theme|2.22.4| |theme-onedark|azemoh|0.6.0| |Theme-TomorrowKit|ms-vscode|0.1.4| |trailing-spaces|shardulm94|0.3.1| |unity-code-snippets|kleber-swf|1.3.0| |unity-debug|Unity|3.0.2| |unity-snippets|YclepticStudios|0.1.2| |vscode-icons|vscode-icons-team|11.5.0| |vscode-language-pack-ru|MS-CEINTL|1.58.8| |vscode-theme-darcula|rokoroku|1.2.3| |vscode-theme-onedark|akamud|2.2.3| |vscode-theme-superonedark|seansassenrath|0.0.15| |vscodeintellicode|VisualStudioExptTeam|1.2.14|;