扩展打包的应用程序Extend your packaged applications

MSIX 允许你使用应用扩展和可选程序包来轻松扩展应用程序。MSIX makes it easy to extend your application using app extensions and optional packages. 应用扩展提供的功能类似于插件、外接程序和加载项在其他平台上提供的功能。App extensions provide functionality similar to what plug-ins, add-ins, and add-ons do on other platforms. 你可以使应用程序成为扩展主机,以允许它使用打包的扩展中的内容和部署事件。You can make your application an extension host to allowing it to consume content and deployment events from an extension packaged. Windows 10 周年纪念版(版本 1607,内部版本 10.0.14393)中引入了应用扩展。App extensions were introduced in the Windows 10 Anniversary edition (version 1607, build 10.0.14393).

可选程序包对于拆分大型或复杂的应用,或者向已发布的应用添加新组件很有用。Optional packages are useful for dividing a large or complex app, or adding new components to an app that's already been published. 使用 Visual Studio 2017 版本 15.7 和 .NET Native 2.1,你可以从 C++ 和 C# 可选程序包加载可执行代码。With Visual Studio 2017, version 15.7 and .NET Native 2.1, you can load executable code from both C++ and C# optional packages.

应用扩展是一个开放的生态系统,可供任何人用来增强你的应用。App extensions are an open ecosystem and are intended for anyone to enhance your app. 对于谁可以创建应用扩展,未设门槛或限制。There is no gating or control over who gets to make an app extension. 可选程序包是一个封闭的生态系统,作为发布者,你可以决定允许谁为你的主程序包创建可选程序包。Optional packages are a closed ecosystem where you as the publisher decides who is allowed to make an optional package for your main package.

应用扩展也是独立的程序包。App extensions are also independent packages. 它们可以是独立的应用,不能依赖于另一个应用进行部署。They can be standalone apps and cannot have a deployment dependency on another app. 可选程序包需要主程序包,并且没有主程序包就无法运行。Optional packages require the primary package and cannot run without it.

主题Topic 说明Description
创建和托管应用扩展Creating and hosting an app extension 本部分讨论了如何在 MSIX 程序包中创建并托管应用扩展。This section discusses how to create and host an app extension in your MSIX package.
应用扩展的自定义属性Custom properties for app extensions 本部分讨论了如何使用应用扩展的自定义属性。This section discusses how to use custom properties for app extensions.
使用可选程序包扩展应用Extending your app using optional packages 本部分讨论了如何利用可选程序包模型将内容加载到主程序包中。This section discusses how to take advantage of the optional package model to load content into your main package.