【发布时间】:2021-03-27 07:47:51
【问题描述】:
我正在尝试在 Visual Studio 中运行一个包,其中包括一个 UWP 和一个控制台。我在以下几行中收到“Appx 包的清单无效。(来自 HRESULT 的异常:0x80080204)”:
private async void OnLoad(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
}
}
在最后一个右括号上。 Windows 10 和 Visual Studio 在我的计算机上是最新的。
这是应用清单:
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity
Name="6d600000-922a-4cd3-8f19-a6afc21809f9"
Publisher="CN=11031121"
Version="1.0.0.0" />
<Properties>
<DisplayName>WapProjTemplate2</DisplayName>
<PublisherDisplayName>11031121</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="WapProjTemplate2"
Description="WapProjTemplate2"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
【问题讨论】:
-
能否请您提供一些关于清单中包装的详细代码?
-
好的,我刚刚编辑了帖子
标签: c# visual-studio uwp