How To: Create MSIX Package in Visual Studio
Its Community Edition was released in 2014 as a free, unrestricted version with similar functionalities to Visual Studio Professional, and it is useful for small development teams or individual developers.
In this article, we would like to share our experience on how to build a package using Visual Studio. Let's do it.
Did you know that Advanced Installer was the first tool to support MSIX and the official Microsoft release partner for MSIX technology? We're constantly updating and enhancing our MSIX support and features - and you check them all for free through the Advanced Installer 30-day, full-feature Trial.
How to build an MSIX package in Visual Studio
For this specific scenario, we are going to use the source code of a very simple application that displays text on the screen when launched.
Check out this video with the entire process of building an MSIX package in Visual Studio. Each step is also documented separately right below it.
1. Open the solution that contains your application project.
2. Add a “Windows Application Packaging Project” to your existing solution. This project template will build your MSIX package.
3. Set the “Target Version” and the “Minimum Version”.
4. Go to “Solution Explorer”, right-click the “Applications” node within the “Windows Application Packaging Project” you created earlier and select “Add Reference”.
5. Select your application project(s) and then click “OK”.
6. Now all the application projects you selected earlier are listed under the “Applications“ node in the “Solution Explorer” window. Right-click the application you want to start when users run the app’s tile, and then select “Set As Entry Point”.
7. Make sure there are no errors when building the “Windows Application Packaging Project”.
8. In the “Solution Explorer” window, double-click the “Package.appxmanifest”.
9. In the “Application” page, set the details of your application.
10. Then, in the “Capabilities” page, select the system features or devices that your application can use.
11. In the “Packaging” page, you can set the details of your MSIX package.
12. All MSIX packages must be digitally signed with a certificate, so we recommend you sign it now (but you can also sign your package at a later stage).
13. Once you've made all the required changes, Save the “Package.appxmanifest”.
14. In the “Solution Explorer” window, identify the Windows Application Packaging Project you added earlier, right-click on it and select “Publish -> Create App Packages…”
15. Select your preferred distribution method and Click “Next”.
16. Choose the signing method, unless you want to sign it later.
17. Set the package details (e.g. version, OS architectures and specify if you want an MSIX bundle to be created for your application)
18. That’s all. Now the MSIX package has been created for you.
You can now browse in the location where the MSIX package was created and double-click on it. You will be prompted with the standard App Installer GUI.
Once the MSIX package is installed, the initial executable built-in Visual Studio will get triggered when we launch our application.
Building an MSIX package in Visual Studio is a simple option for basic applications. However, if you need to include more complex configurations for your package manifest or build an MSI output for Windows 7 (from the same project) -- we recommend to use the free Visual Studio extension for Advanced Installer.
The true value of using Advanced Installer comes from its user-friendly GUI which simplifies the whole process of building and creating the installer for your application (for MSI, App-V or MSIX).
With our free Visual Studio extension, you can create an MSIX build in just two steps. After configuring the build in our VS extension, you can continue editing the project directly into our GUI, by clicking on the “Edit in Advanced Installer” button.
Also, we would love to hear your feedback. Please let us know if this article was helpful and what questions you might have.