Suddenly can't build vst3 in Windows...|Error|MSB3073|The command copy /Y

This has happened to me a few times so I’m posting the “fix” for it here - mainly so that next time it happens and I search for it, I can find my own solution!

The issue is caused by a slightly circular dependency in the building of the VST3. The post-build script for the VST3 project runs a program called juce_vst3_helper which does the final packaging of the VST3 after the DLL has been built. To do that, it actually loads in the DLL. However, if you’ve written a bit of code that causes the loading of the DLL to go pop, then the helper crashes and Visual Studio reports that the VST3 build failed. There is no useful output in the build log to explain what happens - all it does is list the post-build-script and says it failed.

Now the solution:

  • Right-click on the VST3 project and set it as your “Start-up project”
  • Right-click on the VST3 project again and select “Properties”
  • Select “Debugging” in the left column
  • On the “Command” option, click the browse button, and set it to point to the “juce_vst3_helper” executable - you’ll find this in the build/Debug folder of your project.
  • From the output log of your last failed build, find the line that mentions the helper, it will look something like “error MSB3073: Debug\juce_vst3_helper.exe…”
  • Copy the parameters passed to that line into the “Command Arguments” setting in the VST3 properties. It will look something like “-create -version 0.0.0.0 -path…”
  • Click OK on the property page and run your build - it will try to build, fail again, then ask if you wish to run the last successful build - click “Yes”.
  • The debugger will now run the helper and crash at the offending bit of code.
  • Fix the code and it should now compile just fine.

I hope that helps - if so, feel free to buy me a pint at the next ADC :slight_smile:

1 Like