.net Package.appxmanifest(XML)的XPath错误
我需要在应用程序生成过程中更改我的应用程序清单,并尝试为此使用MSBuildCommunityTasks。我使用的目标是:.net Package.appxmanifest(XML)的XPath错误,.net,xml,xpath,msbuild,msbuildcommunitytasks,.net,Xml,Xpath,Msbuild,Msbuildcommunitytasks,我需要在应用程序生成过程中更改我的应用程序清单,并尝试为此使用MSBuildCommunityTasks。我使用的目标是: <XmlUpdate Namespace="" XmlFileName="$(ManifestFile)" XPath="//Identity[@Version]/@Version" Value="$(App_Version).$(Revision)"/> 我的XPath错了。我尝试使用XPat
<XmlUpdate
Namespace=""
XmlFileName="$(ManifestFile)"
XPath="//Identity[@Version]/@Version"
Value="$(App_Version).$(Revision)"/>
我的XPath错了。我尝试使用XPath实时验证器,但是我不能为这个文件选择正确的XPath表达式,我需要一些帮助
我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="1234567890" Publisher="12345678" Version="9.9.9.999" />
<mp:PhoneIdentity PhoneProductId="123456789" PhonePublisherId="1234567890" />
<Properties>
<DisplayName>Name</DisplayName>
<PublisherDisplayName>PlaceHolder</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="DT.PlaceHolder.WP.App">
<m3:VisualElements DisplayName="PlaceHolder" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="PlaceHolder" ForegroundText="light" BackgroundColor="transparent">
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png"></m3:DefaultTile>
<m3:SplashScreen Image="Assets\SplashScreen.png" />
</m3:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
<DeviceCapability Name="location" />
</Capabilities>
</Package>
名称
占位符
资产\StoreLogo.png
6.3.1
6.3.1
我找到了一个解决方案。这对我很有用:
<XmlUpdate
Namespace=""
XmlFileName="$(ManifestFile)"
XPath="//*[local-name()='Identity']/@Version"
Value="$(App_Version).$(Revision)"/>
<XmlUpdate
Namespace=""
XmlFileName="$(ManifestFile)"
XPath="//*[local-name()='Identity']/@Version"
Value="$(App_Version).$(Revision)"/>