- 1 year ago
How do you install .Net Core Hosting Bundle via Azure Pipelines?
To install the .NET Core Hosting Bundle via Azure Pipelines, you can use the Chocolatey
package manager to automate the installation process. Chocolatey is a popular package manager for Windows that can be easily integrated into your Azure Pipelines workflow.
Here are the steps to install the .NET Core Hosting Bundle using Chocolatey in Azure Pipelines:
Make sure you have Chocolatey installed on the build agent where your Azure Pipelines are running. If it's not installed, you can add a script step to install it using PowerShell:
powershellSet-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Add a script step to your Azure Pipelines YAML file to install the .NET Core Hosting Bundle using Chocolatey. The command to install the Hosting Bundle is:
powershellchoco install dotnetcore-windowshosting -y
Your complete Azure Pipelines YAML file might look like this:
yamltrigger:
branches:
include:
- master
pool:
vmImage: 'windows-latest'
steps:
- script: |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
displayName: 'Install Chocolatey'
- script: |
choco install dotnetcore-windowshosting -y
displayName: 'Install .NET Core Hosting Bundle'
Commit and push the changes to your Azure Pipelines YAML file, and the pipeline will automatically trigger when changes are made to the
master
branch.
With these steps, the .NET Core Hosting Bundle will be installed automatically on the build agent during the build process, and your .NET Core applications should run without issues.