dotnet / dotnet/vscode-dotnet-runtime

Failed to install .NET runtime v8.0 in Windows for bicep extensions

Open
#1,666 3 comments 2 reactions 0 assignees View on GitHub
bug cause:missing-permissions cause:powershell-not-found needs more info
Dominant language
TypeScript
Stars
209
Forks
455
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug.

Failed to install .NET runtime v8.0 in Windows for bicep extensions

I'm getting this error:
s-azuretools.vscode-bicep requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.2~x64 ...... Error!
Failed to download .NET 8.0.2~x64:
Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

Error!
Failed to download .NET 8.0.2~x64:
Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

Error!
Failed to download .NET 8.0:
.NET Acquisition Failed: Installation failed: Error: Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

execution policy for user is set to:
Get-ExecutionPolicy
RemoteSigned

![image](https://github.com/dotnet/vscode-dotnet-runtime/assets/48181736/1e674f9f-6926-4b0a-89e2-fc960707e769)

When I tried to add the following manually in the .net settings, the vscode is stuck at acquiring dotnetruntime.
{
"workbench.settings.applyToAllProfiles": [],
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-azuretools.vscode-bicep",
"path": "C:\\Program Files\\dotnet\\dotnet.exe"
}
]
}

![Uploading image.png…]()

### Please attach log file(s) here if you have any.

ms-azuretools.vscode-bicep requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.2~x64 ...... Error!
Failed to download .NET 8.0.2~x64:
Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

Error!
Failed to download .NET 8.0.2~x64:
Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

Error!
Failed to download .NET 8.0:
.NET Acquisition Failed: Installation failed: Error: Your machine policy disables PowerShell language features that may be needed to install .NET. Read more at: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.3.
If you cannot safely and confidently change the execution policy, try setting a custom existingDotnetPath following our instructions here: https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/troubleshooting-runtime.md.

### Reproduction Steps

Download bicep extension and try creating a bicep file. This would load the .netruntime

### Expected Behavior

.netruntime should run

### Exceptions & Errors (if any)

_No response_

### .NET Install Tool Version

v2.0.1

### Your operating system? Please provide more detail, such as the version and or distro above.

Windows

### VS Code Version

1.86.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.