尝试创建 appx 时,远程应用程序服务声明从 package.appxmanifest 中删除

Remote app service declaration gets removed from package.appxmanifest when trying to create appx

我根据 Microsoft documentation 创建了我的 appxmanifest,所以它看起来像这样:

<Application ...>
       ...
  <Extensions>
    <uap:Extension Category="windows.appService">
      <uap3:AppService Name="com.myapp.service" SupportsRemoteSystems="true"/>
    </uap:Extension>
  </Extensions>
</Application>

并且我在 Package 标签中添加了 uap3 定义。

当我使用 Visual Studio 将应用程序部署到我的 PC 和我的 phone 时,它工作正常。但是,当我尝试在 Release 或 Debug 配置中创建一个 appx 包(在两种模式下,sideload 和 for store)时,它会从我的 package.appxmanifest.

中删除 Extension

我是运行Visual Studio2015 Update 3,使用SDK版本14393。(最低版本也设置为14393)

为什么 visual studio 一直从我的清单文件中删除我的远程应用程序服务定义?我该如何解决?

我现在可以重现您的问题。我想这里的问题是因为您在 Create App 中手动检查了 "Automatically increment" 或更改了 Version 向导。

Package version number 设置为 Package/Identity 元素的 Version 属性中的值 Package.appxmanifest 喜欢:

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  IgnorableNamespaces="uap mp uap3">

    <Identity
      Name="Microsoft.SDKSamples.AppServicesProvider.CS"
      Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
      Version="1.0.0.0" />
  ...
</Package>

如果我们在 Create App Packages 中手动检查 "Automatically increment" 或更改 Version ] 精灵。

Visual Studio 将自动更新 Package.appxmanifest。在这种情况下,uap3:AppService 元素也将被删除。如果有任何进展,我会在内部报告这个问题并在这里更新。

目前,作为解决方法,请不要检查"Automatically increment"或更改版本 创建应用程序包 向导中手动。如果需要更改包版本,可以在Package.appxmanifest.

中手动进行

如果您不需要 SupportsRemoteSystems,您可以将 uap3:AppService 更改为 uap:AppService,然后 VS 不会删除它。