Error message "... is not a valid win32 application" on "audio application" project

Trying to run a new “audio plug in” and fail.
I run it from the projucer, with Visual Studio 2017 on a windows 10 PC.

I get the error message:

Microsoft Visual Studio

Unable to start program
C/Users/…/visual studio 2017/x64/Debug/VST/<project_name>.dll

C/Users/…/visual studio 2017/x64/Debug/VST/<project_name>.dll is not a valid win32 application

Any hints on what is missing ?

It doesn’t appear you are building an application since the end result is a .dll file. (Also it looks like to be a VST plugin build since the path to the .dll has VST in it.)

The wording " audio application" is a typo.
I just now corrected to “audio plug in”. Sorry for the confusion.

You can’t debug/run dll files directly. You will need to set the host application to use in the Visual Studio project debugging properties as the Command to run. Also the built dll file of course needs to be in the folder where your host application is scanning for plugins, so you probably want to add a copy step into your build that copies the dll file from your VS project folder into your host’s used VST folder.

More information:

If I copy-paste the DLL into the host (Abelton live for example) - it runs OK. No error message.

But my probelm is that I try to run it from ‘Visual Studio’s’ “Local Windows Debugger”.
With past set up (other PC), I could use it at a similr scenario. but with current set up, it seems something is missing.

There are two ways to do this: You can select a binary to run in your debugger, so you would select ableton for instance, the Debugger would start attached to Ableton, giving you the chance to debug your plugin, if you load it inside Ableton.

Option two is, to add the “Standalone” to the build targets in Projucer and resave the project. Now you can run the plugin in a minimal wrapper.

I am not on windows atm, so I can’t provide screenshots or specific menu names…

The project needs to be set as the “startup project” in Visual Studio in that case but I think Projucer sets that automatically when the standalone application wrapper is added into the build configuration.

Thank for the help.

It seems to work, though I’m still playing with it.
It seems that projucer did not change the debugging option to stand alone automatically.

Greetings. I also have the same problem, but I don’t understand what the final solution is.

I remember having the same issue years ago when I first approached JUCE and the Projucer. In my case it was something about the project’s settings in the projucer before launching it in VS. Did you declared your bus configuration in the projucer? If so, try not to do it there and set it manually in your code in VS. I remember it worked for me, it was an Audio Plugin project and I was using VS2019 with a JUCE version previous than JUCE 6.

The problem here is that Visual Studio is trying to run the “.dll” file created when you compile your code.
“.dll” files can’t be run like a “.exe” executable program, so you need to tell Visual Studio to run a “.exe” program instead.

I set this by going to “Debug” (in the top options bar) → “[Project_Name] Debug Properties”
Under “Configuration Properties” → “Debugging”, you’ll find the Command that VS will try to perform.

To run Ableton when you hit F5, you can change the Command to the file path of the Ableton .exe file, e.g.:
C:\ProgramData\Ableton\Live 11 Suite\Program\Ableton Live 11 Suite.exe

You can also set the command arguments to run the .exe with, but I don’t know what command arguments Ableton has.

Hi, thanks for the reply. What do you mean by bus configuration?

Hi, thanks for the reply. I don’t have Abletom, now I install the trial version then I try to compile from VS

The inputs and output settings (MONO/STEREO in - MONO/STEREO out etc.)

Perfect. Now it works. Thanks for your advice