Solved: Cannot build JUCE 6.1.4 AudioPluginHost in VS 2019

I updated to JUCE 6.1.4 recently. When I try to build the Audio Plugin Host in Visual Studio 2019 now (on Windows 10), it’s giving me an error message:

The build tools for v143 (Platform Toolset = ‘v143’) cannot be found.

Build started...
1>------ Build started: Project: AudioPluginHost_App, Configuration: Debug x64 ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: The build tools for v143 (Platform Toolset = 'v143') cannot be found. 
To build using the v143 build tools, please install v143 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
1>Done building project "AudioPluginHost_App.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I see you now have a target for VS 2022 in the Projucer file, but this shouldn’t affect building it with 2019, should it?

In the Projucer project, for the Visual Studio 2019 Exporter, it shows Platform Toolset v142.

For Visual Studio 2022 Exporter, it shows Platform Toolset v143.

However, if I launch the project from Projucer into my Visual Studio 2019 installation (I do not have 2022), the platform toolset is somehow set to v143:

So I changed the Platform Toolset manually in the VS 2019 Properties to v142, and now it builds again.

I just shut down VS 2019 and relaunched it again from the Projucer - and it resets the Platform Toolset to v143. This seems a bug.

EDIT: Furthermore, it’s building in the AudioPluginHost/Builds/VisualStudio2022 folder! Again, I do not have 2022 on this machine.

Furthermore, it’s building in the AudioPluginHost/Builds/VisualStudio2022 folder! Again, I do not have 2022 on this machine.

Did you select VS2019 in the “Selected exporter” field at the top of the Projucer UI before exporting the project to Visual Studio?

1 Like

OMG, I’ve been using JUCE for two years and I swear I never noticed that or had to change it. I’ve only ever used VS 2019, and I guess in the past VS 2019 was automatically selected since it was the latest version supported, and now that 2022 has been added, that is selected when you launch the project. My mistake, and thank you. :blush: