How to build a specific project/target with msbuild?

Can someone please share the mystery combination that eludes me on how to build just the VST from a solution in Visual Studio?

My plugin solution has a VST, AAX & App. To build all of them, I’ve been running this:

"c:\Program Files (x86)\MSBuild\14.0\Bin\msbuild" ^
Synth.sln /p:Configuration=Release

But I’d like to build just the VST, so it seems that I should use /t:Project:Target, so I tried this:

"c:\Program Files (x86)\MSBuild\14.0\Bin\msbuild" ^
    Synth.sln /p:Configuration=Release /t:Synth_VST:Rebuild

But that, or any other combination I’ve tried doesn’t work.

Anyone? Thanks.

Are you sure?
I’ve just tried it with the GainPlugin (from latest tip of develop).
And ran:
JUCE\examples\PlugInSamples\GainPlugIn\Builds\VisualStudio2015> msbuild GainPlugIn.sln /p:Configuration=Release /t:GainPlugIn_VST:rebuild

It worked…
The only issue I had was the first time it complaint about V110 missing.
Which I’ve resolved by nasty registry changes as suggested here: http://stackoverflow.com/questions/22229548/error-the-imported-project-c-program-files-x86-msbuild-microsoft-cpp-v4-0-v

MSBuild is very frustrating tool IMHO compared the xcodebuild.
However it’s possible to do almost anything if you decide to dig-in and make your own MSBuild XMLs where you can define almost anything. but I wouldn’t say it’s a great command line tool :wink:

What kind of error are you getting, you just said “doesn’t work”? I’m doing the exact same thing, building a specific target from a project and the /t: parameter is definitely the weapon of choice, so my gut feeling is something inside your project configuration is preventing this from working. I don’t have multiple formats in one solution, but that’s obviously working for you when you do an all-build.

Best,
Andreas

I keep getting

error MSB4057: The target "Synth_VST:rebuild" does
not exist in the project. [V:\Programming\Synth\Builds\VisualStudio2015-64\Synth.sln]

This is standard JUCE VS 2015 solution that Projucer created. I didn’t do anything odd to it.

I just copied and pasted your command line and got this:

"V:\Programming\JUCE\examples\PlugInSamples\GainPlugIn\Builds\VisualStudio2015\GainPlugIn.sln" (GainPlugIn_VST:rebuild
target) (1) ->
  V:\Programming\JUCE\examples\PlugInSamples\GainPlugIn\Builds\VisualStudio2015\GainPlugIn.sln.metaproj : error MSB4057
: The target "GainPlugIn_VST:rebuild" does not exist in the project. [V:\Programming\JUCE\examples\PlugInSamples\GainPl
ugIn\Builds\VisualStudio2015\GainPlugIn.sln]

???

The problem was I was using the wrong name for the target. I was using Synth_VST and I should have been using “Synth - VST”.

I suspect there is another thing you’ve missing.
Sounds like you haven’t build your projucer for a while. Especially with develop branch.
They’ve changed the project names which is the reason your target failed and also added the missing default build flag that’s very needed with MSbuild

Yes exactly, we’ve removed the spaces from the project names. Really wasn’t the brightest idea to have them in the first place :blush:.