You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Visual Studio Code settings, set the dotnetAcquisitionExtension.sharedExistingDotnetPath to the Windows path to the dotnet executable.
In WSL, open a Bicep folder in Visual Studio Code (with Bicep extension enabled for WSL) and the message below will be displayed.
The reason for using dotnetAcquisitionExtension.sharedExistingDotnetPath is that this is a restricted environment where the .NET install tool is refused to be executed since there are restricted policy for PowerShell execution, and using this setting is the only way around, so it is not an option removing it.
Action: bicep.activate
Error type: Error
Error Message: Failed to find dotnet executable at path '/mnt/c/Users/USER/AppData/Local/Programs/Microsoft VS Code/C:\Program Files\dotnet\dotnet.exe'.
Version: 0.29.47
OS: linux
OS Release: 5.15.153.1-microsoft-standard-WSL2
Product: Visual Studio Code
Product Version: 1.93.1
Language: en
@dozer75 I believe that in WSL, the dotnet command is going to be executed inside a virtualized Linux environment. I suspect you'd need to install the dotnet SDK inside WSL, and then use the Linux path to the SDK. C:\Program Files\dotnet\dotnet.exe is a Windows executable, and I wouldn't expect it to run on Linux.
This isn't something I've tried - not sure if anyone in the community has an example of how to achieve this. If you get it working, please share your steps!
@anthony-c-martin You are right (and I have installed the SDK on WSL already), however the issue is that the path that I have configured in VS Code for Windows is used by the Bicep extension in WSL, which shouldn't be used. Removing the setting will cause the Windows environment to break so that's not an option.
Does this occur consistently? Yes
Repro steps:
dotnetAcquisitionExtension.sharedExistingDotnetPath
to the Windows path to the dotnet executable.The reason for using
dotnetAcquisitionExtension.sharedExistingDotnetPath
is that this is a restricted environment where the .NET install tool is refused to be executed since there are restricted policy for PowerShell execution, and using this setting is the only way around, so it is not an option removing it.Action: bicep.activate
Error type: Error
Error Message: Failed to find dotnet executable at path '/mnt/c/Users/USER/AppData/Local/Programs/Microsoft VS Code/C:\Program Files\dotnet\dotnet.exe'.
Version: 0.29.47
OS: linux
OS Release: 5.15.153.1-microsoft-standard-WSL2
Product: Visual Studio Code
Product Version: 1.93.1
Language: en
Call Stack
The text was updated successfully, but these errors were encountered: