Search code examples
c#windows.net-8.0winui-3winui

How do I package a WinUI app as exe setup file or something that includes all dlls while installation?


I am facing while packaging a WinUI app. As by using the publish and package option directly from VS Studio creates the msix file but when I install that file in other computers, I realized that all libraries(dll) for libraries that were installed using Nuget aren't present in the installation. But when I copy the files and dlls from debugging results to other computer's installation directory. Then its starts working.

Can anyone explain what to do so as to package the file into a single file which will include all dlls to put in installation directory.

Packaging Results from Direct options

Can anyone tell how to create a single installation msix package or even better an exe setup file like we have with other softwares


Solution

  • For Winui3 project, here is a workaround. If you need to include DLL in MSIX package form Visual Studio, you need to add the dll file to the WinUI3 project, right click on the project -> Add existing item -> add your dll file -> set the Content property to true.