gpt4 book ai didi

msbuild - Azure DevOps 管道构建代理 : how to use or replace $(DevEnvDir) in assembly reference HintPath?

转载 作者:行者123 更新时间:2023-12-04 04:22:08 24 4
gpt4 key购买 nike

我在本地有 Visual Studio 2019 Professional,Azure DevOps 管道构建代理有 Enterprise。

如何在项目文件中引用 ReferenceAssemblies,在本地和构建代理中解析?

项目文件:在本地构建,但管道构建因路径错误而失败:

<HintPath>$(ProgramFiles)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>

项目文件:在 azure devops pipeline 中构建,但由于路径错误导致本地构建失败:

<HintPath>$(ProgramFiles)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>

项目文件:在本地构建,但管道构建失败,因为 $DevEnvDir 未定义:

<HintPath>$(DevEnvDir)\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>

我觉得我在这里遗漏了一些简单的东西......

最佳答案

您可以使用条件:

<Reference Include="Mono.Android.dll">
<HintPath Condition="Exists('$(ProgramFiles)\Microsoft Visual Studio\2019\Professional')">$(ProgramFiles)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>
<HintPath Condition="Exists('$(ProgramFiles)\Microsoft Visual Studio\2019\Enterprise')">$(ProgramFiles)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll</HintPath>
</Reference>

关于msbuild - Azure DevOps 管道构建代理 : how to use or replace $(DevEnvDir) in assembly reference HintPath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58910754/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com