|
| 1 | +--- |
| 2 | +title: Troubleshoot problems with Bicep installation |
| 3 | +description: How to resolve errors and problems with your Bicep installation. |
| 4 | +ms.topic: conceptual |
| 5 | +ms.date: 11/18/2021 |
| 6 | +--- |
| 7 | + |
| 8 | +# Troubleshoot Bicep installation |
| 9 | + |
| 10 | +This article describes how to resolve potential errors in your Bicep installation. |
| 11 | + |
| 12 | +## .NET runtime error |
| 13 | + |
| 14 | +When installing the Bicep extension for Visual Studio Code, you may run into the following error messages: |
| 15 | + |
| 16 | +```error |
| 17 | +Failed to install .NET runtime v5.0 |
| 18 | +``` |
| 19 | + |
| 20 | +```error |
| 21 | +Failed to download .NET 5.0.x ....... Error! |
| 22 | +``` |
| 23 | + |
| 24 | +To solve the problem, you can manually install .NET from the [.NET website](https://aka.ms/dotnet-core-download), and then configure Visual Studio Code to reuse an existing installation of .NET with the following settings: |
| 25 | + |
| 26 | +**Windows** |
| 27 | + |
| 28 | +```json |
| 29 | +"dotnetAcquisitionExtension.existingDotnetPath": [ |
| 30 | + { |
| 31 | + "extensionId": "ms-azuretools.vscode-bicep", |
| 32 | + "path": "C:\\Program Files\\dotnet\\dotnet.exe" |
| 33 | + } |
| 34 | +] |
| 35 | + |
| 36 | +``` |
| 37 | + |
| 38 | +**macOS** |
| 39 | + |
| 40 | +If you need an **x64** installation, use: |
| 41 | + |
| 42 | +```json |
| 43 | +"dotnetAcquisitionExtension.existingDotnetPath": [ |
| 44 | + { |
| 45 | + "extensionId": "ms-azuretools.vscode-bicep", |
| 46 | + "path": "/usr/local/share/dotnet/x64/dotnet" |
| 47 | + } |
| 48 | +] |
| 49 | +``` |
| 50 | + |
| 51 | +For other **macOS** installations, use: |
| 52 | + |
| 53 | +```json |
| 54 | +"dotnetAcquisitionExtension.existingDotnetPath": [ |
| 55 | + { |
| 56 | + "extensionId": "ms-azuretools.vscode-bicep", |
| 57 | + "path": "/usr/local/share/dotnet/dotnet" |
| 58 | + } |
| 59 | +] |
| 60 | +``` |
| 61 | + |
| 62 | +See [User and Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings) for configuring Visual Studio Code settings. |
| 63 | + |
| 64 | +## Two versions of Bicep CLI installed |
| 65 | + |
| 66 | +If you manually install the Bicep CLI to more than one location, you may notice unexpected behavior such as the Bicep CLI not updating when you run the [upgrade command](bicep-cli.md#upgrade). Or, you may notice that running `az bicep version` returns one version, but `bicep --version` returns a different version. |
| 67 | + |
| 68 | +To resolve this issue, you can either update both locations, or delete one location and add the other location to your path. |
| 69 | + |
| 70 | +To **keep both installation locations**, use `az bicep upgrade` to update one version. For the other version, use the same method you used earlier to [manually install the Bicep CLI](install.md#install-manually). |
| 71 | + |
| 72 | +To **keep only one installation location**, use the following steps: |
| 73 | + |
| 74 | +1. Open your command prompt (not PowerShell), and run `where bicep`. This command returns the location of the Bicep installation. |
| 75 | +1. Delete the installation that was returned in the previous step. |
| 76 | +1. Remove the location from your **PATH** environment variable. |
| 77 | +1. Add your other installation location to the **PATH** variable. For Windows, the location maintained by Azure CLI is `%USERPROFILE%\.Azure\bin`. |
| 78 | + |
| 79 | +## Next steps |
| 80 | + |
| 81 | +For more information about using Visual Studio Code and the Bicep extension, see [Quickstart: Create Bicep files with Visual Studio Code](./quickstart-create-bicep-use-visual-studio-code.md). |
0 commit comments