il2cpp Compile errors - Windows desktop [Unity 2019.2.15f1]

Hi
Having difficulty compiling a project for Windows desktop on a new laptop.
I’ve installed Visual Studio 2019 which by default I believe also installs the C++ and .NET 4 frameworks.
Also downloaded and installed the Windows 7 SDK since this was listed in the errors.
Then rebooted.

But still get 3 compile errors which seem to be il2cpp related!

This is just the first of 3 errors.

Failed running C:\Program Files\Unity\Hub\Editor\2019.2.15f1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x64" --configuration="Debug"
--outputpath="C:\Users\foo\Desktop\<path to project>\Temp/StagingArea/Data\Native\GameAssembly.dll"
--cachedirectory="C:\Users\foo\Desktop\<path to projecty>\Assets\..\Library/il2cpp_cache"
--profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.2.15f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe"
--directory=C:/Users/foo/Desktop/<path to project>Temp/StagingArea/Data/Managed --generatedcppdir=C:/Users/foo/Desktop/<path to project>/Temp/StagingArea/Data/il2cppOutput

stdout:
il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
        Visual Studio 2010 with C++ compilers and Windows 7 SDK (it cannot build C++ code because it is not installed)
        Visual Studio 2010 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir" in the registry
        Windows 7 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" in the registry

        Visual Studio 2013 with C++ compilers and Windows 8.1 SDK (it cannot build C++ code because it is not installed)
        Visual Studio 2013 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\12.0_Config\InstallDir" in the registry
        Windows 8.1 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1\InstallationFolder" in the registry

        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)

I don’t believe that Unity 2019.2 supports VS 2019. You will need to install VS 2017 in order for this to work correctly. Note that you can use VS 2019 with Unity 2019.3 and later though.

Ok there really needs to be more info about il2cpp building for windows - many people find they can not compile due to missing components of VS or perhaps unsupported versions.
While it mentions very old versions of VS in such errors (like is 2010 supported?!), VS Community 2019 is supported by Unity 2018 LTS for instance, yet error messages say 2017 only.

To fix the errors try installing Visual Studio through the Unity Hub/editor which apparently installs all required components

@JoshPeterson Afaik 2019.2 supports VS 2019. Not only does the blog post for the 2019.2 release under “Tools for programmers” mention this:

In the Unity Hub, you can also only choose “Microsoft Visual Studio Community 2019” when you “Add Modules”.

OP, have you checked that the C++ tools are indeed installed?

Necro for old post, but I had this error too. Unity would not build and run any URP projects, including their sample.
Solution: Download and install SDK from microsoft.