Forum Discussion
DataBen
Jun 27, 2025Copper Contributor
MSIX .wapproj service
My agency is trying to move their services to MSIX/UWP and we found that the VisualStudio .wapproj .appxmanifest templates $targetnametoken$ and $targetentrypoint$ do not work for the properties 'Exe...
DataBen
Jun 30, 2025Copper Contributor
Thanks you for waiting.
This is the cleaned appxmanifest:
<?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:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="Service" Publisher="CN=Company" Version="0.0.0.0"/>
<Properties>
<DisplayName>Service</DisplayName>
<PublisherDisplayName>Company</PublisherDisplayName>
<Logo>logo.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>
<Capabilities>
<rescap:Capability Name="packagedServices"/>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application
Id="App"
Executable="SomeApp.exe"
EntryPoint="Program">
<uap:VisualElements
DisplayName="Service"
Description="Service"
BackgroundColor="transparent"
Square150x150Logo="large.png"
Square44x44Logo="small.png"/>
<Extensions>
<desktop6:Extension
Category="windows.service"
Executable="SomeApp.exe"
EntryPoint="Program">
<desktop6:Service
Name="Service"
StartupType="manual"
StartAccount="localService"/>
</desktop6:Extension>
</Extensions>
</Application>
</Applications>
</Package>
Assuming that the mentioned files and publisher exist, this packs as expected.
It gets interesting when the following two attributed are changed:
<Application Executable="SomeApp.exe" [...]
<Extension Executable="SomeApp.exe" [...]
This combination works:
<Application Executable="$targetnametoken$.exe" [...]
<Extension Executable="SomeApp.exe" [...]
While this one returns an error:
<Application Executable="SomeApp.exe" [...]
<Extension Executable="$targetnametoken$.exe" [...]
The returned error is:
The file name "$targetnametoken$.exe" declared for element "*[local-name()='Applications']/*[local-name()='Application']/*[local-name()='Extensions']/*[local-name()='Extension' and not(@Category='windows.backgroundTasks' or @Category='windows.appService')]" doesn't exist in the package.
Jul 01, 2025
It looks like you found your answer, or at least one that you can use for now.
That would be a problem that whoever owns the WAP project at Microsoft would need to fix. They aren't going to see this here, so you might want to report it (especially with the detail above) on a dev channel that they are listening on. (Sorry, but I don't know where that would be).