In a new Visual Studio 2019 solution I have created a .Net Core Console Project and a UWP Project that I am packaging using a Windows Application Packaging Project. At this stage I am able to compile and run all of these projects without issue.
My next task is to add the compiled output of the console application as a windows.fullTrustProcess
in the Package.appxmanifest for the packaging project:
<?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:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap uap3 desktop rescap">
<Identity
Name="7260053b-0cee-406a-a6ce-0842444e35eb"
Publisher="CN=Publisher"
Version="1.0.0.0" />
<Properties>
<DisplayName>DisplayName</DisplayName>
<PublisherDisplayName>DisplayName</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="DisplayName"
Description="Description"
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" />
<rescap:Capability Name="allowElevation" />
</Capabilities>
<Extensions>
<uap3:Extension Category="windows.fullTrustProcess" Executable="MyConsoleApp.exe"/>
</Extensions>
</Package>
When I attempt to build the packaging project I get the following build error:
Error APPX0501: Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 40, Column 6, Reason: Element '{http://schemas.microsoft.com/appx/manifest/uap/windows10/3}Extension' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extensions'. Expecting: {http://schemas.microsoft.com/appx/manifest/foundation/windows10}Extension, {http://schemas.microsoft.com/appx/manifest/foundation/windows10}ExtensionChoice.
I have tried different combinations of Extension
, uap:Extension
, desktop:Extension
and they all give me similar errors. I believe fundamentally I don't understand enough about the appxmanifest namespaces to diagnose the problem.
How can I correctly declare my fullTrustProcess extension?
Please put the
Extensions
inside theApplication
block.Like the following: