Search code examples
azure-devops-self-hosted-agent

How to fulfil Visual Studio demand for self-hosted docker build agent?


I've successfully setup and run a self hosted docker build agent using the instructions here: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops however VS builds won't run on that agent because it doesn't fulfil a demand for Visual Studio. So my question is

How do install Visual Studio in the docker build agent?

However I've got a feeling this is the wrong question as the project can be build from the command line using dotnet, so an alternative question might be

How to I remove this demand for VS from my build pipeline?

I can't see as I've declared this demand anywhere in the YAML.


Solution

  • How do install Visual Studio in the docker build agent?

    For this issue, you can install Visual Studio Build Tools in docker file and then use the built image in the container.

    For details, please refer to this official document.