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!

Any way to build a .NET solution just as how it builds in Visual Studio ?



  • Hi,

    I have my solution with more than 100 projects. I ideally would like to do something as what my current build scripts or VS does. Currently, I just build the solution file and each projects outputs to its respective 'bin\Release' folder. I then simply package the executables based on their files in the output dir which is bin\Release for each project.

    I am trying to achieve the same with BM but could not do this in the same way how I can do this in VS. In BM, if I build my solution with any action (either build .Net project or MSBuild action), always the OutDir defined in BM, makes all the projects' output go in to the same, single OutDir folder. All projets in the entire solution build in to single output folder. So, ideally, to prepare the deployable components, I first need to build the solution (to check for any build errors) and then have to individually build projects, so I can sepcify individual output folder for each build action !

    This seems so basic but may be I am missing something and could not get to meaningfully build my solution.

    Is this possible at all ? Any help is appreciated.

    Thanks.



  • Unfortunately this is a limitation of building solutions with MSBuild (which is what the Build .NET Project action uses).

    You could use an "Execute Command Line" action that builds the solution with Visual Studio (e.g. c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe /build "Release" "YourSolution.sln"). This of course requires that Visual Studio is installed on the machine you're building on.

    Check out http://msdn.microsoft.com/en-us/library/xee0c8y7.aspx for the full list of command line options.



  • But if I use 'Execute Command Line' action, will Build Master know if the action fails. Can the Build Master workflow be made dependent on the outcome of the execute command line action ?

    How can I achieve this ?

    Thanks.



  • Sure, in the action there are "Success Conditions" that determine whether the action succeeds or fails such as text written to stderr or based on the exit code.



  • Thanks for the reply. But I dont think it is a limitation of MSBuild.exe. I currently, have build script which builds the same solution in the way I described, generating binaries to respective outdirs.
    See below :

    <!--Build the Solution-->
    <Target Name="Build" DependsOnTargets="Clean">
    <ItemGroup>
    <Solutions Include="$(SolutionRoot)*.sln"></Solutions>
    </ItemGroup>
    <Message Text="===Building==="></Message>
    <Message Text="Solutions:"></Message>
    <Message Text="@(Solutions)"></Message>
    <MSBuild Projects="@(Solutions)" Targets="Build" Properties="Configuration=$(BuildConfiguration);DefineConstants=$(BuildConstants)" StopOnFirstFailure="true"/>
    </Target>

    SolutionRoot - is the path of my solution.

    As you can see, I just use the above target in my script which neatly does what I was describing in my question. I would think the problem is in BuildMaster forcing an ourdir as a param to MsBuild.

    Pls correct me if I have missed anything.



  • Actually this is a limitation with the "OutputDir" property applied by the action. We will release an update to the .NET extension that would add an option to nullify the target directory when a solution is specified since it would have multiple.



  • Yes,I would think the same. Thanks for clarifying.

    Please plan to release this fix at the earliest possible and would be glad if you can keep us informed on the same. For now, building .NET projects is really turning out to be a painful task just because of this one issue. Fortunately, there are some tedious workarounds.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation