Launching server using command dotnet failed.
Does this occur consistently? Yes Repro steps:
- Removed older extension
- Added 0.1.226 using Install from VSIX option
- reloaded
- Opened .bicep file and getting errors below
Action: bicep.activate Error type: string Error Message: Launching server using command dotnet failed.
Version: 0.1.226-alpha OS: linux OS Release: 4.19.128-microsoft-standard Product: Visual Studio Code Product Version: 1.50.1 Language: en
Does an empty bicep file produce the same error? If not, can you share the file?
Also, can you share the output from the "Output" tab:

Yes, created an empty emtpy.bicep file. Closed and relaunched VSCode (code .) and then opened the empty file:

Bicep output log
[Error - 8:38:30 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.
2020-11-05T08:38:29.978Z info: Current log level: debug.
2020-11-05T08:38:29.980Z info: Launching Bicep language service...
2020-11-05T08:38:29.991Z debug: Found dotnet command at '/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.9/dotnet'.
2020-11-05T08:38:29.991Z debug: Found language server at '/home/trevor/.vscode-server/extensions/azure.vscode-bicep-0.1.226-alpha/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-05T08:38:29.999Z info: Bicep language service started.
Log (Window)
[2020-11-05 08:38:25.752] [renderer1] [error] spawn dotnet ENOENT: Error: spawn dotnet ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
I've since been back and tried earlier releases. I'm seeing the same issue with 1.223 but 1.37 still works for me.
Steps:
- Uninstall 1.226
- Reload
- Install 1.223
- Reload
- Open empty bicep file – fails
- Uninstall 1.223
- Reload
- Install 1.37
- Reload
- Open empty bicep file – works!
@lr90 Are you launching code . from within a WSL cmd prompt? If so, do you happen to know which version of WSL you are running?
Does this extension work if launched via VSCode in Windows not through WSL?
I'm on WSL2
N A M E S T A T E V E R S I O N
* U b u n t u R u n n i n g 2
d o c k e r - d e s k t o p S t o p p e d 2
d o c k e r - d e s k t o p - d a t a S t o p p e d 2
If I launch VSCode from within a command prompt several extensions I use are only enabled for WSL:Ubuntu. I have however tried this and added the Bicep 1.226 extension (which then shows as globally enabled) but once I start editing a Bicep file it throws errors about failure to install .Net runtime 3.1 (!!) and installing .NET: Dotnet Core Acquisition
The 1.37 extension is working for me when VSCode is launched from both CMD and WSL
OK, not sure what I did different but I now have 1.226 running when launched in cmd and editing 'local' files (C:\users...)
Switching (or launching using code . ) to Remote-WSL
to edit files in /source/trevor/... is still failing
I was able to repro this locally by installing WSL2 and WSL remoting. At least for me, this was caused by the issue that this PR fixes: https://github.com/dotnet/vscode-dotnet-runtime/pull/130.
If I click on "Report an issue", and view the log file that is linked in the issue text, I see "/home/ant/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.1.2/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected". Is this the same problem you're seeing?
That seems very familiar but though I can repeat the failure that text (it never persisted) no longer seems to pop up and raising an issue just repeats the report at the beginning of this thread. I don't appear to have any links to log files?
This has been fixed with vscode-dotnet-runtime 0.2.0, which should now be pulled down by default with the extension
OK, attempted to reinstall the extension today to see if this is now fixed. It failed but I did capture the error:
"An error occurred while installing .NET (3.1): .NET Acquisition Failed: Command failed: "/home/trevor/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.2.0/dist/install scripts/dotnet-install.sh" -InstallDir "/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10" -Runtime dotnet -Version 3.1.10 /home/trevor/.vscode-server/extensions/ms-dotnettools.vscode-dotnet-runtime-0.2.0/dist/install scripts/dotnet-install.sh: 7: Syntax error: newline unexpected"
I not it is referring to dotnet-runtime-0.2.0 though
OK, seems like a reload of VSCode is required before the 3.1 acquisition works under both Windows and WSL. However with dotnet-runtime-0.2.0 and 3.1 runtime downloaded I still get an error launching the Bicep extension under WSL:
2020-11-11T11:29:00.973Z info: Current log level: debug.
2020-11-11T11:29:00.977Z info: Launching Bicep language service...
2020-11-11T11:29:00.993Z debug: Found dotnet command at '/home/trevor/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-11T11:29:00.994Z debug: Found language server at '/home/trevor/.vscode-server/extensions/azure.vscode-bicep-0.1.226-alpha/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-11T11:29:01.006Z info: Bicep language service started.
[Error - 11:29:01 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.
Might hang fire on WSL until Bicep 0.2 comes out
@anthony-c-martin congrats for getting 0.2.3 out!
I've updated my bicep install and the code extension but the issue loading the extension under WSL is still there
2020-11-12T10:43:46.386Z info: Current log level: debug.
2020-11-12T10:43:46.390Z info: Launching Bicep language service...
2020-11-12T10:43:46.404Z debug: Found dotnet command at '/home/username/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-12T10:43:46.405Z debug: Found language server at '/home/username/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.3/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-12T10:43:46.414Z info: Bicep language service started.
[Error - 10:43:46 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.
Thanks for pointing this out - reopening this issue to investigate.
I have same problem in dev container.
2020-11-16T01:15:31.823Z info: Current log level: debug.
2020-11-16T01:15:31.824Z info: Launching Bicep language service...
2020-11-16T01:15:35.423Z debug: Found dotnet command at '/home/vscode/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-16T01:15:35.423Z debug: Found language server at '/home/vscode/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.3/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-16T01:15:35.430Z info: Bicep language service started.
[Error - 1:15:35 AM] Starting client failed
Launching server using command dotnet failed.
Error: Launching server using command dotnet failed.
@lr90, @takekazuomi Please could you try this with v0.2.14? To test you'll need to fetch it manually from https://github.com/Azure/bicep/releases/ and use the "install from VSIX" option in VSCode, as it hasn't yet been published to the VSCode marketplace.
I'm able to repro this behavior with v0.2.3, but not with v.0.2.14, I believe because of the fix in #910
@anthony-c-martin I have confirmed that it works fine with v0.2.14.
2020-11-16T04:33:30.192Z info: Current log level: debug.
2020-11-16T04:33:30.193Z info: Launching Bicep language service...
2020-11-16T04:33:34.236Z debug: Found dotnet command at '/home/vscode/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/3.1.10/dotnet'.
2020-11-16T04:33:34.236Z debug: Found language server at '/home/vscode/.vscode-server/extensions/ms-azuretools.vscode-bicep-0.2.14/bicepLanguageServer/Bicep.LangServer.dll'.
2020-11-16T04:33:34.244Z info: Bicep language service started.
2020-11-16T04:33:35.376Z info: Bicep language service ready.
I appreciate your help.
Yep, all good here too and feels much better to be back in WSL :-) Many thanks for fixing.
Anyone coming here after manually installing dotnet 5.0 runtime on macOS with M1: The path for dotnet was different from what the dotnet installer said.
Here is my settings.json part that works for me:
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-azuretools.vscode-bicep",
"path": "/usr/local/share/dotnet/x64/dotnet"
}
]
I am a bit confused how to setup VS Code and bicep extension to work with dotnet 6. Why do we need dotnet 5?
I am a bit confused how to setup VS Code and bicep extension to work with dotnet 6. Why do we need dotnet 5?
Bicep (v0.4.1008 and lower) is currently built against dotnet 5, so you need to use dotnet 5 to run it. Next release (ETA this week), we will switch to dotnet 6. This means that the workaround suggested by @cloudchristoph will no longer be necessary.