tags:

views:

58

answers:

1

I need to run an external MSBuild thread from inside another MSBuild project. What I need to do is to pass the /noconsolelogger to the task . How can I do this, please help!

+1  A: 

foo.csproj

<Project DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    <Target Name="BuildAll">
        <Message Text="foo"/>
        <Exec Command="MSBuild.exe bar.csproj /noconsolelogger"/>
    </Target>
</Project>

bar.csproj

<Project DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    <Target Name="BuildAll">
        <Message Text="bar"/>
    </Target>
</Project>

Output contains the message 'foo', but not 'bar'.

mhanney
Thanks mhanney. I understand your suggestion is to use <Exec ...> instead of <MSBuild ...> directly. +1 vote for you but it would be greater to have an option for <MSBuild...>. Using <Exec...> task is quite annoying when defining properties.
Nam Gi VU
I understand the annoyance of not being able to use <MSBuild ..> directly. Thanks for the +1.
mhanney