Open chausner-audeering opened 3 years ago
@chausner-audeering The C# extension lists *.sln as a trigger for loading the extension in VS Code. We should be smarter in this scenario, so that we do not keep the solution file open.
As a workaround for this issue, you may want to consider disabling the C# extension for the workspace.
As a workaround for this issue, you may want to consider disabling the C# extension for the workspace.
Thanks for that hint, I'll give it a try!
Issue Description
The OmniSharp.exe process running in the background of VS Code keeps an open handle to the folder containing VS solution files even when the solution is deleted. The open handle prevents one from deleting the folder than previously contained the solution.
Note that the solution file does not even contain any C# but only C++ projects. I do have other .NET projects in subfolders of my VS code workspace folder though.
Steps to Reproduce
I am using CMake to build a C++ project using the Visual Studio generator. I am calling CMake in the VS Code terminal roughly like so:
As part of the configuration step, CMake generates a .sln file in the build folder which apparently OmniSharp opens in the background. As soon as I run my build script again, the script fails to delete the old
build
folder because OmniSharp Server still keeps an open handle to the folder (even though all files in it, including the .sln file are deleted). Also manually deleting the folder in Windows Explorer does not work, only killing the OmniSharp.exe process makes the folder deletable.Logs
OmniSharp log
Environment information
VSCode version: 1.52.1 C# Extension: 1.23.8
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\ Host (useful for support): Version: 5.0.1 Commit: b02e13abab .NET SDKs installed: 1.1.11 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [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| |---|---|---| |cmake|twxs|0.0.17| |cmake-tools|ms-vscode|1.5.3| |cpptools|ms-vscode|1.1.3| |csharp|ms-dotnettools|1.23.8| |electron-debug|kodetech|18.11.1| |git-graph|mhutchie|1.28.0| |git-merger|shaharkazaz|0.4.1| |gitlens|eamodio|11.1.0| |gitstash|arturock|3.3.1| |hexeditor|ms-vscode|1.3.0| |jupyter|ms-toolsai|2020.12.414227025| |opensmile-config-files|chausner|1.4.0| |powershell|ms-vscode|2020.6.0| |python|ms-python|2020.12.424452561| |rainbow-csv|mechatroner|1.8.0| |remote-wsl|ms-vscode-remote|0.52.0| |vscode-catch2-test-adapter|matepek|3.6.19| |vscode-command-runner|edonet|0.0.116| |vscode-guid|heaths|1.4.20| |vscode-test-explorer|hbenl|2.19.3|;