2

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 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?

junky_user
  • 385
  • 1
  • 3
  • 10

3 Answers3

6

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" />

Did it help?

Ben
  • 3,241
  • 4
  • 35
  • 49
sagie
  • 2,998
  • 3
  • 22
  • 31
  • actually the MSbuild file is in a folder called Tests.The dll folder is one hierarchy above this folder – junky_user Jan 20 '10 at 17:02
  • 1
    The `AssemblyFile="&(AssemblyFileName)"` should be `AssemblyFile="$(AssemblyFileName)"` (dollar sign instead of ampersand) – Jon Adams Dec 21 '10 at 03:13
1

Make sure that you are writing correctly the relative path "..\dll\Gallio.MSBuildTasks.dll". I've tried this and i had no problems in specifying relative paths to my dll's. If the path is not correct you should get an error stating this when you run the build file. If it won't work you can post the error that you get when you use the relative path.

Adrian Fâciu
  • 12,414
  • 3
  • 53
  • 68
  • (RunTests target) -> F:\project\trunk\prj\bll\runtests.prj(15,9): error : An unexpected error occurred during execution of the Gallio task. F:\project\trunk\prj\bll\runtests.prj(15,9): error : Ru ntimeException: Could not resolve component for service type 'Gallio.Runner.Pro jects.ITestProjectManager' because there do not appear to be any components reg istered and enabled for that service type.\r F:\project\trunk\prj\bll\runtests.prj(15,9): error : a t Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescrip tor(Type serviceType)\r – junky_user Jan 20 '10 at 07:39
0

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

Steve Cooper
  • 20,542
  • 15
  • 71
  • 88