如何在msbuild文件中给出相对路径? [英] How to give relative path in msbuild file?

查看:135
本文介绍了如何在msbuild文件中给出相对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个msbuild文件以使用galio运行测试.现在,我需要给出

I am writing an msbuild file to run tests using galio.Now, I need to give

<UsingTask AssemblyFile="..\dll\Gallio.MSBuildTasks.dll" TaskName="Gallio" />

当我给出完整路径c:\ program file \ galio \ bin时,这不起作用,但是,我想在Gallio.MSBuildTasks.dl所在的源代码控制中给出我的dll文件夹的路径.为此吗?

This does not work, when I give full path c:\program file\galio\bin,it works.But, I want to give path to my dll folder in source control where Gallio.MSBuildTasks.dl is located.How to do this?

推荐答案

路径相对于什么? 可能不在您执行msbuild的地方. 如果该路径相对于您的MSBuild文件所在的位置,请尝试将相对路径与MSBuild文件路径连接起来:

Is the path relative to what? Probably not to where you are executing msbuild from. If the path is relative to where your MSBuild file is, try to concatenate the relative path with the MSBuild File path:

<PropertyGroup>
   <AssemblyFileName>$(MSBuildProjectDirectory)\..\dll\Gallio.MSBuildTasks.dll</AssemblyFileName>
</PropertyGroup>
<UsingTask AssemblyFile="$(AssemblyFileName)" TaskName="Gallio" />

有帮助吗?

这篇关于如何在msbuild文件中给出相对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆