Visual Studio 2019 publish prerequisites dialog is missing .NET Framework 4.8

I found a solution on VS Developer Community website which also works to add the .NET Framework 4.8 to the Prerequisites dialog.

The trick is, to pretend the installer that VS 2015 is installed:

  1. Create this path (if not exist):
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages
  2. On 64 bit machine, create the registry key
    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\GenericBootstrapper\14.0
    On 32 bit machine, create the registry key
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\14.0
  3. In the just created 14.0 key, create a String named Path with the just created folder path as value
    (C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages).
  4. Run the .NET 4.8 developer pack setup ndp48-devpack-enu.exe (Repair or Install).
  5. Remove the registry key from step 2 (only if you created it).
  6. Copy the DotNetFX48 folder from the created path (step 1)
    to C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages
  7. Restart Visual Studio.

Note:

  • Setting the Path string value to the actual target path (C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages) will not work.