Search code examples
msbuildexecbuilding

Build Project from Separate Solution


I have a .dll that my project uses which is generated by a project in a separate solution.

I have a conditional MSBuild Target which will build this project and copy the .dll if the .dll does not exist.

I am building with this command inside my Target:

<Exec Command="MSBuild Bar.vcxproj /p:Configuration=$(Configuration)" WorkingDirectory="..\..\Foo\Bar" />

Is there an MSBuild command that I could use to accomplish this other than Exec?


Solution

  • You can use the MSBuild task for this, something like:

    <MSBuild Projects="..\..\Foo\Bar\Bar.vcxproj" Properties="Configuration=$(Configuration)"/>