dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
137 stars 257 forks source link

Bicep language service does not work in WSL because it cannot install .Net #309

Open chudytom opened 3 years ago

chudytom commented 3 years ago

Repro steps:

  1. I downloaded the extension and opened a bicep file. The language server started working and it shouted that it cannot download .Net.

  2. I tried to install .Net manually. And the SDK version is: 5.0.401. One important thing is that I'm running WSL (Ubuntu 20.04). On Windows, the language server works without problems

Extension Version: 1.0.0 Error Message: .NET Acquisition Failed: Installation failed: Error: Command failed: "/home/anonymous/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/install scripts/dotnet-install.sh" -InstallDir "/home/anonymous/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/5.0.10" -Version 5.0.10 -Runtime dotnet /home/anonymous/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected

Error Stack: Error: .NET Acquisition Failed: Installation failed: Error: Command failed: "/home/anonymous/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/install scripts/dotnet-install.sh" -InstallDir "/home/anonymous/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/5.0.10" -Version 5.0.10 -Runtime dotnet /home/anonymous/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected

at /home/anonymous/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.3.0/dist/extension.js:2:13778
at processTicksAndRejections (internal/process/task_queues.js:93:5)

The file located at /home//.vscode-server/data/logs/20210928T101017/exthost5/ms-dotnettools.vscode-dotnet-runtime/DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1633010973546.txt was empty

sfoslund commented 3 years ago

@chudytom is the issue content correct, that you're using version 1.0.0 of the extension? If so, can you try upgrading and see if you still have the problem?

chudytom commented 3 years ago

@sfoslund I get errors from 2 extensions. First is coming from Bicep extension with the following issue info Action: bicep.activate Error type: Error Error Message: Failed to install redacted:url runtime v5.0.

Version: 0.4.613 OS: linux OS Release: 5.10.16.3-microsoft-standard-WSL2 Product: Visual Studio Code Product Version: 1.60.2 Language: en

Call Stack ``` extension.js:2:1930344 o extension.js:2:1919521 processTicksAndRejections task_queues.js:93:5 ```

Then there is another error as Bicep seems to depend on ".NET Install Tool for Extension Authors". That's the error I pasted above. And for some reason it says that the extension version is 1.0.0, however the installed version is 1.3.0 image

hansmbakker commented 2 years ago

On my laptop it looks like /home/myusername/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-1.5.0/dist/install scripts/dotnet-install.sh is actually a powershell script which is not meant to be run in WSL2... super weird.

At least it should not be interpreted and executed as a .sh file!

hansmbakker commented 2 years ago

Workaround:

chudytom commented 2 years ago

The workaround provided by @hansmbakker worked :)