首页 > 解决方案 > Azure devops server - use custom condition to build a csproj if it exists (or ignore if it doesn't) to get rid of "partial success"

问题描述

I'm using Azure DevOps Server 2019 and I want to run a "Visual Studio build" task only if a csproj exists, or just move on if it doesn't. At the moment, I attempt to build the file and put up with the task failing and an overall "partial success" if it doesn't exist. I'd prefer to improve this with a "Custom condition" rather than inline powershelling it if I can.

标签: tfsazure-devopsazure-pipelinestfsbuild

解决方案


“自定义条件”无法达到您的要求,您可以在“Visual Studio build”任务之前添加一个powershell任务,以检查csproj是否存在并输出变量。然后在“Visual Studio build”任务的条件下使用这个变量。


推荐阅读