I have an MSBuild task to build a specific project in a solution file. It looks something like this:
<Target Name="Baz">
<MSBuild Projects="Foo.sln" Targets="bar:$(BuildCmd)" />
</Target>
From the command line, I can set my BuildCmd
to either Rebuild
or Clean
and it works as expected:
msbuild /target:Baz /property:BuildCmd=Rebuild MyMsbuildFile.xml msbuild /target:Baz /property:BuildCmd=Clean MyMsbuildFile.xml
But what word do I use to set BuildCmd
to in order to just build? I've tried Build
and Compile
and just leaving it blank or undefined, but I always get an error.
msbuild /target:Baz /property:BuildCmd=Build MyMsbuildFile.xml Foo.sln : error MSB4057: The target "bar:Build" does not exist in the project.
msbuild /target:Baz /property:BuildCmd=Compile MyMsbuildFile.xml Foo.sln : error MSB4057: The target "bar:Compile" does not exist in the project.
msbuild /target:Baz MyMsbuildFile.xml Foo.sln : error MSB4057: The target "bar:" does not exist in the project.