Understanding the App package manifest

Gabriela Gutierrez
3 min readSep 4, 2020

The app package manifest is one of the most important files when defining our MSIX package. We discussed MSIX packages in this post, and we also included a brief explanation about the app package manifest file. On this occasion, we are going to explore its main structure plus several concepts like capabilities, and extensions.

Package manifest schema

This file is located in the root of your package project, and its name, by default, is Package.appxmanifest. You will open its designer view by just double-clicking on it. There, you’ll be able to configure several items like assets, capabilities, declarations, and the properties that identify and describe your app.

To open the schema file, just right-click on the file and select View Code, or press the F7 key.

You’ll see node sections inside a general Package node. As the documentation states, the Package node defines the root element. Then you’ll find nodes like Identity, Dependencies, Resources, Applications, and Capabilities. All of them are defined in more detail in the Microsoft documentation.

In the next sections, we will discuss two of the most used ones: Capabilities and Extensions.

Capabilities

You need to define capabilities in your package manifest file to access certain Windows 10 APIs, or to access resources like pictures, music, documents, files, folders, or devices such as cameras, USB drives, and more. You can add them using the designer view, or manually modifying the XML file.

There are several types:

  • General-use capabilities: as the documentation says, these capabilities apply to the most common app scenarios (e.i. music, pictures, videos, removable storage, custom devices, among many others).
  • Device capabilities: these capabilities allow access to peripheral and internal devices. Some examples are the microphone, webcam, USB, WI-FI, and several more.
  • Restricted capabilities: these capabilities require Microsoft approval. As the documentation states:

Restricted capabilities are intended for very specific scenarios. The use of these capabilities is highly restricted and subject to additional Store onboarding policy and review. Note that you can sideload apps that declare restricted capabilities without needing to receive any approval. Approval is only required when submitting these apps to the Store.

When adding these capabilities, Visual Studio will add one warning for every restricted capability you’ve added. The reason is that Microsoft wants to make it clear that you’ll have to justify why are you using them. Here you can check a link where this topic is treated and Microsoft response.

  • Custom capabilities: these capabilities are similar to restricted capabilities in terms that you’ll have to follow the same approval process.

Extensions

According to Microsoft’s documentation, an extension is like an agreement between an app and the operating system. Extensions let app developers extend or customize standard features primarily for use in their apps and potentially for use in other apps.

Through extensions, you can create a firewall exception, or make your application the default application for a file type. These examples are some of the things you can achieve by adding them to your package manifest file.

Your application will need a package identity to use them. A package identity is a unique identifier for a package, and it’s represented by a tuple of attributes like Name, ProcessorArchitecture, Publisher, Version, and ResourceId. You can generate the package identity by packaging your application in an MSIX package or through a sparse package.

Microsoft has several examples in its documentation of how to use extensions here. Additionally, this is the link to all the extensions’ types available.

Summary

When you package your application, the package manifest is one of the most important files of your solution. This file includes general information about your application, the assets you’ve included, and all the information related to how your application will interact with Windows, other applications, and the user. Knowing about its schema, capabilities, and extensions, will give you the tools to create a robust application.

--

--