【问题标题】:Change Version in Package.appxmanifest in Xamarin UWP在 Xamarin UWP 中的 Package.appxmanifest 中更改版本
【发布时间】:2019-06-30 12:37:23
【问题描述】:

我想在下面的代码中更改Identity Version 的值

    <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" >
<Identity Name="Sample.Product " Publisher="CN=1234" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="456" PhonePublisherId="0" />
</Package>

我尝试使用以下 XmlPoke 代码进行更改。

    <XmlPoke XmlInputPath="Package.appxmanifest" Namespaces="&lt;Namespace Prefix='n' Uri='http://schemas.microsoft.com/developer/vsx-schema/2011' Name='N' /&gt;" Query="/n:Package/n:Identity/@Version" Value="$(Version)" />

该行不会更改版本。

上面的代码出了什么问题?

【问题讨论】:

  • 正在构建的应用程序的版本。这通常会在每次修改和打包应用程序时递增。为确保 Version 正确递增,请使用调用 Store -> Create App Packages... 时提供的对话框进行更新。

标签: xamarin versioning xamarin.uwp


【解决方案1】:

您正在寻找的标识位于 Package 的默认命名空间中,因此在您的 XmlPoke 中您需要使用该命名空间。为此,请将 XmlPoke 的 URI 更改为 http://schemas.microsoft.com/appx/manifest/foundation/windows10,如下所示:

    <XmlPoke XmlInputPath="Package.appxmanifest" Namespaces="&lt;Namespace Prefix='n' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10' /&gt;" Query="/n:Package/n:Identity/@Version" Value="$(Version)" />

【讨论】:

    猜你喜欢
    • 2017-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-17
    • 2017-01-09
    • 1970-01-01
    • 1970-01-01
    • 2017-03-27
    相关资源
    最近更新 更多