[英]Set working directory in azure devops with Visual Studio build task
I'm trying to build a project which requires to set the working directory to a path.我正在尝试构建一个需要将工作目录设置为路径的项目。
On my local machine I could go with Visual Studio 2019 and go to Project - Properties - Debugging - Command Arguments and set it to whatever I want.在我的本地机器上,我可以使用 Visual Studio 2019 和 go go 到项目-属性-调试-命令 Arguments并将其设置为任何我想要的。 The problem is that I don't know how to do with Visual Studio build task .
问题是我不知道如何处理Visual Studio build task 。
If I do not set this settings, it produces an executable that doesn't launch.如果我不设置此设置,它会生成一个无法启动的可执行文件。
here is my build pipeline: https://dev.azure.com/nathanvalletmarseille/armorpaint/_build?definitionId=5&_a=summary这是我的构建管道: https://dev.azure.com/nathanvalletmarseille/armorpaint/_build?definitionId=5&_a=summary
It's not able to directly set this with build-in visual studio build task.它无法使用内置的 Visual Studio 构建任务直接设置它。
However, you could do this through a script before you run the build task:但是,您可以在运行构建任务之前通过脚本执行此操作:
- script: # script path or inline
workingDirectory: #
displayName: #
failOnStderr: #
env: # mapping of environment variables to add
More details take a look at this similar question: Change current working directory in Azure Pipelines更多细节看看这个类似的问题: Change current working directory in Azure Pipelines
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.