Reputation: 1987
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.
Upvotes: 0
Views: 409
Reputation: 31075
Your requirement can not be achieved with a "Custom condition", you may add a powershell task before "Visual Studio build" task to check whether the csproj exists and output an variable. Then use this variable in the condition of "Visual Studio build" task.
Upvotes: 2