[英]Is it possible to get the visual studio build folder name over azure devops?
We are using azure devops for CI/CD, but we got a problem with our build pipelines.我们正在为 CI/CD 使用 azure devops,但我们的构建管道出现问题。 When creating visual studio build, we would like to get the specific folder where the build is created, so we can copy the folder (add outputpath parameter to visual studio task doesn't work with some projects).
在创建Visual Studio 构建时,我们想获取创建构建的特定文件夹,因此我们可以复制该文件夹(在Visual Studio 任务中添加输出路径参数不适用于某些项目)。
The main problem is, that name of the project and the repo can be different.主要问题是,项目名称和仓库名称可能不同。 We would need something like:
我们需要类似的东西:
$(agent.builddirectory)\s\PROJECT-NAME\bin\Release
Is there a way to get the project name or the output folder?有没有办法获取项目名称或 output 文件夹?
$(agent.builddirectory)
isn't working. $(agent.builddirectory)
不起作用。
EDIT: We need to use the build pipelines at this point, so currently we don't work with artifacts or release pipelines (we know we should...)编辑:此时我们需要使用构建管道,所以目前我们不使用工件或发布管道(我们知道我们应该......)
It seems like you are using Azure Pipelines to do what MSBuild / dotnet cli are made to help you.您似乎正在使用 Azure 管道来执行 MSBuild / dotnet cli 为您提供的帮助。
You can instead use msbuild / dotnet cli to build and pack your project output to a designated location, like output
in the repository root folder, that is common across all projects that use the pipeline.您可以改为使用 msbuild / dotnet cli 来构建项目 output 并将其打包到指定位置,例如使用存储库根文件夹中的
output
,这在所有项目中都是通用的。
If you only checkout 1 repository, all tasks will be executed in the repository folder.如果您只签出 1 个存储库,则所有任务都将在存储库文件夹中执行。 You do not need to mess with
$(agent.builddirectory)\s\xxxx
.你不需要弄乱
$(agent.builddirectory)\s\xxxx
。 Accessing output
is as simple as output/
in your pipeline.访问
output
就像管道中的output/
一样简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.