Search code examples
azure-pipelinesmaui

Is there any way to speed up 'dotnet workload install maui'?


In azure devops pipelines the 'dotnet workload install maui' step takes 5 to 10 minutes for every build. Is there any way to speed this up? For example by caching or using an image where this is already installed?

This is run by the following task in an azure devops pipeline:

- task: CmdLine@2
    displayName: 'Install Maui'
    inputs:
      script: 'dotnet workload install maui'

Solution

  • Since you need to speed up the process of installing maui workload, you can refer to the following situations.

    When you using Microsoft-Hosted agent, you can consider using Windows-latest agent.

    The maui has been pre-installed in the Windows-latest agent. Refer to this doc: Windows2022-Readme.md

    For example: Windows-latest agent

    enter image description here

    In this case, you can skip the dotnet workload install maui step. And we can directly use it in windows-latest agent.

    When we using Ubuntu or macOS Microsoft-hosted agent, it took about 2 minutes. It's an improvement relative to your current situation.

    For example: macOS-latest agent

    enter image description here

    If the pre-installed version and runtime still do not meet your needs, you can consider using Self-hosted agent.

    In this case, you can manually install the maui workload in the local machine where the agent is located. Then you can use it directly in the pipeline.