.netwinformsinstallationsetup-projectvisual-studio-setup-proje

Build a setup for a WinFroms .NET 6 using Microsoft Visual Studio Installer Project


I used Visual studio setup/installer project template to build a setup for my App last year(in VS19) and it worked well . after some changes I was forced to migrate to.Net6 and I tried to build a setup with this tool( in Vs22). I was able to install the app using the MSI file generated but the app wouldn't run. the tool doesn't generate any dependencies for the primary output and I don t know why. could that be the problem ?

setup folder

I tried different frameworks with no results.


Solution

  • Option 1 - Add Published Items instead of Primary Project Output

    You can add publish items instead of primary output. To do so:

    1. Right click on your setup project > Add > Project output
    2. Choose the Windows app from dropdown
    3. In the list choose Publish Items

    Press OK, and do the rest of the configurations you need, rebuild and install the setup project.

    This doesn't show all dependencies, but it deploys the whole things that which are considered as part of published items which are necessary for the app. You can later add required prerequisites like .NET runtime.

    enter image description here