dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

Failed to find dotnet info from path #6926

Open IllyaYushchenko opened 9 months ago

IllyaYushchenko commented 9 months ago

Type: Bug

Issue Description

С# extention is failing to find dotnet info from path. Unable to debug dotnet app.

after executing in terminal export DOTNET_ROOT="/home/ilyus/.asdf/installs/dotnet/6.0.418" export MSBuildSDKsPath="/home/ilyus/.asdf/installs/dotnet/6.0.418/sdk/6.0.418/Sdks" debugging works but output of c# extention still same - "Failed to find dotnet info from path"

Steps to Reproduce

setup - VScode in WSL with dotnet versions managed by asdf.

Expected Behavior

find the dontet info from path debug the app

Actual Behavior

see in logs

Logs

C# log

Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime No compatible .NET runtime found. Minimum required version is 7.0. Dotnet path: /home/ilyus/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.16~x64/dotnet Activating C# + C# Dev Kit + C# IntelliCode... waiting for named pipe information from server... [stdout] {"pipeName":"/tmp/ddd658da.sock"} received named pipe information from server attempting to connect client to server... client has connected to server

when trying to debug the app

------------------------------------------------------------------------------ You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you develop and test your applications. ------------------------------------------------------------------------------ You must install .NET to run this application. App: (...) Architecture: x64 App host version: 6.0.26 .NET location: Not found Learn about runtime installation: https://aka.ms/dotnet/app-launch-failed Download the .NET runtime: https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=ubuntu.22.04-x64&apphost_version=6.0.26 The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.

But same time command

dotnet --info - yields this

dotnet --info .NET SDK (reflecting any global.json): Version: 6.0.418 Commit: 21f869269c Runtime Environment: OS Name: ubuntu OS Version: 22.04 OS Platform: Linux RID: ubuntu.22.04-x64 Base Path: /home/ilyus/.asdf/installs/dotnet/6.0.418/sdk/6.0.418/ global.json file: /home/ilyus/projects/(...)/backend/global.json Host: Version: 6.0.26 Architecture: x64 Commit: dc45e96840 .NET SDKs installed: 6.0.418 [/home/ilyus/.asdf/installs/dotnet/6.0.418/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.26 [/home/ilyus/.asdf/installs/dotnet/6.0.418/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.26 [/home/ilyus/.asdf/installs/dotnet/6.0.418/shared/Microsoft.NETCore.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info

Environment information

VSCode version: 1.86.2 C# Extension: 2.18.16 Using OmniSharp: false

Dotnet Information Host: Version: 7.0.16 Architecture: x64 Commit: 567edafe61 .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.NETCore.App 7.0.16 [/home/ilyus/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.16~x64/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download ❯ asdf list dotnet *6.0.418 7.0.405 8.0.101
Visual Studio Code Extensions |Extension|Author|Version|Folder Name| |---|---|---|---| |azure-account|ms-vscode|0.11.6|ms-vscode.azure-account-0.11.6| |black-formatter|ms-python|2024.0.1|ms-python.black-formatter-2024.0.1| |copilot|GitHub|1.165.0|github.copilot-1.165.0| |copilot-chat|GitHub|0.12.2|github.copilot-chat-0.12.2| |csdevkit|ms-dotnettools|1.3.10|ms-dotnettools.csdevkit-1.3.10-linux-x64| |csharp|ms-dotnettools|2.18.16|ms-dotnettools.csharp-2.18.16-linux-x64| |debugpy|ms-python|2024.0.0|ms-python.debugpy-2024.0.0-linux-x64| |dotnet|leo-labs|1.3.0|leo-labs.dotnet-1.3.0| |dotnet-core-essentials|KishoreIthadi|0.0.8|kishoreithadi.dotnet-core-essentials-0.0.8| |gitblame|waderyan|10.9.0|waderyan.gitblame-10.9.0| |prettier-vscode|esbenp|10.1.0|esbenp.prettier-vscode-10.1.0| |python|ms-python|2024.0.1|ms-python.python-2024.0.1| |sonarlint-vscode|SonarSource|4.3.0|sonarsource.sonarlint-vscode-4.3.0-linux-x64| |vscode-azurefunctions|ms-azuretools|1.13.3|ms-azuretools.vscode-azurefunctions-1.13.3| |vscode-azureresourcegroups|ms-azuretools|0.8.4|ms-azuretools.vscode-azureresourcegroups-0.8.4| |vscode-azurestorage|ms-azuretools|0.15.3|ms-azuretools.vscode-azurestorage-0.15.3| |vscode-dotnet-runtime|ms-dotnettools|2.0.1|ms-dotnettools.vscode-dotnet-runtime-2.0.1| |vscode-eslint|dbaeumer|2.4.4|dbaeumer.vscode-eslint-2.4.4| |vscode-pylance|ms-python|2024.2.2|ms-python.vscode-pylance-2024.2.2| |vscode-tailwindcss|bradlc|0.10.5|bradlc.vscode-tailwindcss-0.10.5| |vscodeintellicode-csharp|ms-dotnettools|0.1.26|ms-dotnettools.vscodeintellicode-csharp-0.1.26-linux-x64|;

Extension version: 2.18.16 VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:40:56.878Z) OS version: Windows_NT x64 10.0.19045 Modes: Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-1260P (16 x 2496)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|47.71GB (20.37GB free)| |Process Argv|--folder-uri=vscode-remote://wsl+Ubuntu/home/ilyus/projects/(...)/backend --remote=wsl+Ubuntu --crash-reporter-id 0af36038-9747-4d94-831c-bad4dc0a8f71| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|12th Gen Intel(R) Core(TM) i7-1260P (16 x 2495)| |Memory (System)|19.54GB (11.77GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|12th Gen Intel(R) Core(TM) i7-1260P (16 x 2495)| |Memory (System)|19.54GB (11.77GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 d34g3935:30971562 edj9j583:30969295 7j2b6412:30969109 e3gdj431:30958358 ```
IllyaYushchenko commented 9 months ago

upd. apparently C# extention can't recognoze local .tool-versions file, but somehow reflects to global one.

but if dotnet versions is 6, it can't find it for some reason. and it claims that Minimum required version is 7.0.

and if c# extention does resolve dotnet version from the PATH, then c# devkit doesnt find it =/