csharp formatter not installed
See original GitHub issueIssue 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
OmniSharp server started. Path: c:\Users\OdIUm.vscode\extensions\ms-dotnettools.csharp-1.23.13.omnisharp\1.37.12\OmniSharp.exe PID: 16616
Starting OmniSharp on Windows 6.2.9200.0 (x64)
DotNetPath set to dotnet
System.IO.FileNotFoundException: P:\Development\Visual Studio 2019\MSBuild\Current\Bin\Microsoft.Build.dll
в System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
в OmniSharp.MSBuild.Discovery.MSBuildInstanceProvider.GetMSBuildVersion(String microsoftBuildPath) в D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\MSBuildInstanceProvider.cs:строка 104
в OmniSharp.MSBuild.Discovery.Providers.MicrosoftBuildLocatorInstanceProvider.<>c.<GetInstances>b__1_0(VisualStudioInstance instance) в D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Providers\MicrosoftBuildLocatorInstanceProvider.cs:строка 30
в System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() в System.Linq.Buffer
1…ctor(IEnumerable1 source) в System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
в System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) в OmniSharp.MSBuild.Discovery.MSBuildLocator.GetInstances() в D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\MSBuildLocator.cs:строка 115 в OmniSharp.MSBuild.Discovery.Extensions.GetBestInstance(IMSBuildLocator msbuildLocator, Version minimumMSBuildVersion, ILogger logger, Boolean& invalidVSFound, Boolean& vsWithoutSdkResolver) в D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Extensions.cs:строка 109 в OmniSharp.MSBuild.Discovery.Extensions.RegisterDefaultInstance(IMSBuildLocator msbuildLocator, ILogger logger, DotNetInfo dotNetInfo) в D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Extensions.cs:строка 17 в OmniSharp.CompositionHostBuilder.Build(String workingDirectory) в D:\a\1\s\src\OmniSharp.Host\CompositionHostBuilder.cs:строка 71 в OmniSharp.Stdio.Host..ctor(TextReader input, ISharedTextWriter writer, IOmniSharpEnvironment environment, IServiceProvider serviceProvider, CompositionHostBuilder compositionHostBuilder, ILoggerFactory loggerFactory, CancellationTokenSource cancellationTokenSource) в D:\a\1\s\src\OmniSharp.Stdio\Host.cs:строка 49 в OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_1.<Main>b__1() в D:\a\1\s\src\OmniSharp.Stdio.Driver\Program.cs:строка 74 в OmniSharp.HostHelpers.Start(Func
1 action) в D:\a\1\s\src\OmniSharp.Host\HostHelpers.cs:строка 29
[ERROR] Error: OmniSharp server load timed out. Use the ‘omnisharp.projectLoadTimeout’ setting to override the default delay (one minute).
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-download
Visual 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 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top GitHub Comments
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.
Reinstalling did not fix the issue for me.