Bundling .NET Desktop Runtime Prerequisites in Visual Studio Deployment Projects

Hi Jason,

You’ll want to configure your installer to act as a bootstrapper that checks for and installs the required .NET Desktop Runtime before your WinForms utility runs. In Visual Studio, this is done through the Setup Project’s Prerequisites dialog. Open your installer project, go to Project Properties, then click Prerequisites. From there, select the appropriate .NET Desktop Runtime version (for example, “.NET Desktop Runtime 6.0.x”) from the list. Visual Studio will then embed the bootstrapper logic into your MSI/Setup.exe so that during installation it checks the target machine, and if the runtime is missing, it automatically downloads and installs it.

If you want to avoid external downloads entirely, you can package the offline installer for the runtime alongside your setup files. Place the redistributable in the same output directory and configure the bootstrapper to use the “Download prerequisites from the same location as my application” option. This ensures the runtime installer is bundled and deployed locally without requiring internet access. Microsoft’s official documentation on Visual Studio bootstrapper packages confirms this is the supported method for distributing .NET runtimes internally.

If the above response helps answer your question, please hit “Accept Answer” so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

Harry.

Read more here: Source link