简体   繁体   English

是否可以通过 azure devops 获取 Visual Studio 构建文件夹名称?

[英]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.

相关问题 如何在 azure devops 中运行 Visual Studio 构建 - How to run visual studio build in azure devops 使用 Visual Studio 构建任务在 azure devops 中设置工作目录 - Set working directory in azure devops with Visual Studio build task Azure DevOps 2019 查看 Visual Studio 中的构建过程 - Azure DevOps 2019 view build process inside Visual Studio 是否可以在Visual Studio中更改引用(dll)默认生成文件夹? - Is possible to change references (dlls) default build folder in visual studio? 是否可以在Visual Studio中重命名项目,以便还重命名其文件夹名称? - Is it possible to rename a project in Visual Studio such that its folder name is also renamed? Visual Studio - Azure DevOps 编码不匹配 - Visual Studio - Azure DevOps encoding mismatch Visual Studio 2019 删除了 azure devops 连接 - visual studio 2019 remove an azure devops connection Azure DevOps - Visual Studio - 本地调试 - Azure DevOps - Visual studio - Local debugging Azure Devops上的Net Core 3.0 SDK Preview 9的Visual Studio Build失败 - Visual Studio Build Fails for Net Core 3.0 SDK Preview 9 on Azure Devops 如何通过 Visual Studio 2008 在 azure DevOps 中构建 C# 代码? - How to build C# Code in azure DevOps via visual studio 2008?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM