这是我第一次制作 Windows 通用应用程序,但我无法在我的 UWP 应用程序中制作所有内容(例如,无法启动命令行进程)。因为这是一个个人应用程序(我不想把它放在商店里),所以我使用 windows.fullTrustProcess 来启动一个 WPF win32 应用程序,以完成我在主应用程序中无法做到的事情。我也被迫使用 UWP,因为我需要一个能够播放全屏 html5 视频的 WebView。
当我尝试在 Visual Studio 2017 中使用我的应用程序时,一切正常,但是当我尝试制作包时,我收到此错误:
“清单验证错误:第 28 行,第 64 列,原因:为元素“ [local-name()='Applications']/ [local-name()='Application ']/ [local-name()='Extensions']/ [local-name()='Extension' and @Category='windows.fullTrustProcess']" 包中不存在。"
但我的“Backend-Mini-Browser.exe”位于“..\bin\x64\Debug\AppX”文件夹中,一切都在 Visual Studio 2017 中运行。
这是我的appxmanifest:
<?xml version="1.0" encoding="utf-8"?>
<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:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" IgnorableNamespaces="uap mp desktop rescap">
<Identity Name="2579cda2-1e8c-48ee-829a-b1d276066cfe" Publisher="CN=Certimeter" Version="1.0.3.0" />
<mp:PhoneIdentity PhoneProductId="2579cda2-1e8c-48ee-829a-b1d276066cfe" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Mini-browser</DisplayName>
<PublisherDisplayName>Certimeter</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Mini_browser.App">
<uap:VisualElements DisplayName="Mini-browser" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Mini-browser" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="Backend-Mini-Browser.exe" />
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="picturesLibrary" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
这里:
<rescap:Capability Name="runFullTrust" />
我有一个警告:命名空间“ http://schemas.microsoft.com/appx/manifest/foundation/windows10 ”中的元素“Capabilities”在命名空间“ http://schemas. microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities ”。可能的列表:命名空间“http://schemas.microsoft.com/appx/manifest/foundation/windows10”中的“CapabilityChoice”和命名空间“ http://schemas.microsoft.com/appx/manifest ”中的“Capability” /uap/windows10和命名空间中的“能力”“ http://schemas.microsoft.com/appx/manifest/foundation/windows10 ”和命名空间中的“能力””和命名空间“http://schemas.microsoft.com/appx/manifest/uap/windows10/3”中的“能力”和命名空间“ http://schemas.microsoft.com/appx/manifest ”中的“能力” /uap/windows10/2和命名空间“http://schemas.microsoft.com/appx/manifest/foundation/windows10”中的“CustomCapabilityChoice”和命名空间“ http://schemas.microsoft.com ”中的“CustomCapability” /appx/manifest/uap/windows10/4和命名空间“ http://schemas.microsoft.com/appx/manifest/foundation/windows10 ”中的“DeviceCapability ”。
(这个警告是我用英文翻译的,但我认为这不是主要问题)。