Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

MSBuild action and /p:OutDir parameter causing issues.



  • I have a .NET .sln file that I am trying to build with the "Build .NET Project" action. The solution builds fine, but my issue seems to be that BuildMaster is automatically adding the parameter to msbuild.exe: "/p:OutDir=D:\BuildMaster_SVCTMP_A5_S0\WRK".

    The issue is that with this parameter passed, all the individual .csproj projects in the solution ignore their individual build output paths, and all build to \WRK\ now.

    So, for example, if I have 2 Projects in my Solution, "MyProj" and "MyProj.Tests", lets say both individual projects have their build output directory set to "\bin".

    So if I were to open VisualStudio and build it, I would end up with:
    {SolutionDir}\MyProj\bin
    {SolutionDir}\MyProj.Tests\bin\

    So all the files I want to "deploy" for real are in "{SolutionDir}\MyProj\bin" (i.e. the unit test .dll fromt eh Tests project isn't in there).

    Now, in BuildMaster, with it specifying /p:OutDir, I end up with both projects building to \WRK, so both MyProj.dll and MyProj,Tests.dll are both in \WRK.

    This makes it a pain to separate out the items I want to deploy.

    My real-life situation is more complicated, because my .sln contains 2 different .csproj files that are ASP.NET applications, whose output deploys to 2 different servers, so I really want their outputs from MSBuild to stay completely separate, so I can deploy them.

    Is there something I am missing, or not setting up correctly? As a bit of background, this same .sln has been run in CruiseControl.net, and we later moved to TeamCity, but are now evaluationg BuildMaster for a possible mote to it instead. This .sln build fine in CC.net and TC, and their outputs stayed where the .csproj files indicated, just like VisualStudio had built them.

    Thanks for any help!



  • Hi Jeff,

    The build project action is designed to give you the project output, and building a solution will (sometimes) yield odd results depending on config.

    One option to try (which will still use the same behavior) is this:

    1. Delete * from ~\Src
    2. Get Latest to ~\Src
    3. Build Project from ~\Src\MyProj1\MyProj1.csproj to ~\MyProj1
    4. Build Project from ~\Src\MyProj2\MyProj2.csproj to ~\MyProj2
    5. ...

    Alternatively, just run the MSBuild action on the solution file instead of the build project action.



  • Karl, thank you for the quick reply. We have 13 separate projects in just 1 of our solutions, so I was avoiding the tedious job of setting up an action to build each individually.

    What I ended up doing, and making work, was to just execute mstest.exe on the command line without the /p:OutDir parameter, using an "Execute Command Line" task.

    Not sure how that will play with the tasks that come after the build, but I suspect as long as I manage my paths correctly in the subsequent actions, it should be OK.

    Thanks again for the assistance.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation