Reputation: 4929
I have a question regarding the commandline options of msbuild. I am currently using msbuild to build projects using the existing solution files. These solution files have references to external dll which have different paths on each machine. I am currently writing a build script and passing the specific path to the project file via the /p: switch of msbuild.
My current build line is: msbuild test.sln /p:ReferencePath="c:\abc" /p:ReferencePath="c:\rca"
What i have noticed that Reference Path now contains only c:\rca and not c:\abc. this is causing problems for me since, the external dlls lie in two different directorys. I am allowed to keep multiple reference paths via visual studio, but not via the commandline.
Is there any known way by which i can do this
Upvotes: 0
Views: 1669
Reputation: 466
The command line options for setting the reference path will work just fine (assuming you escape the semi colon, it seems both %3B and ;
will work). However, when the argument was passed in from nant (and I needed multiple paths), creating a 'Visual Studio Project User Options file' seemed to work better.
I just emit (echo) a file to the file system with the following format:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ReferencePath>
C:\abc;c:\rca
</ReferencePath>
</PropertyGroup>
I give the *.user file an appropriate name (given a project file MyProject.csproj, my user file would be MyProject.csproj.user)
Upvotes: 0
Reputation: 9708
Although the correct syntax for providing more the one reference path is listed above, I would suggest solving the root cause which in my opinion is the different locations of your referenced assembly. I would suggest you put all thirdparty dependencies, apart from the framework assemblies in your source code repository for the following reasons:
Upvotes: 3
Reputation: 1412
You may be better off by synchronizing your libraries across machines. I have found that Visual Studio makes this easy. Simply add a solution folder, and add your libraries there. Then, in each project, reference the libraries from this common place. This way, each developer has them in the same place.
This will remove one of variables you have when trying to script out builds.
Upvotes: 0
Reputation: 473
Try seperating your pathes with a semi-colon (;)
Like this:
c:\abc;c:\rca
Upvotes: 0