How to specify relative path in msbuild file?

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

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

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

+1
msbuild
Jan 20 '10 at 6:56
source share
3 answers

Is there a way regarding what? Probably not where you are running msbuild. If the path is relative to the location of your MSBuild file, try associating the relative path with the MSBuild File:

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

Did it help?

+4
Jan 20 '10 at 12:07
source share

Make sure you write the relative path ".. \ dll \ Gallio.MSBuildTasks.dll" correctly. I tried this and I had no problem determining the relative paths to my DLL. If the path is incorrect, you should receive an error message when you run the build file. If this does not work, you can post the error you get when using the relative path.

+1
Jan 20 '10 at 7:15
source share

You can use $(MSBuildThisFileDirectory) , according to this MSDN page .

+1
Jun 15 '15 at 20:05
source share



All Articles