1

I am trying to make a simple ServiceApp in UWP following this Microsoft article https://learn.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service

However, the manifest change suggested by this article is causing my service app to not build.

enter image description here

I have spent days searching Microsoft documentation for terms such as "http://schemas.microsoft.com/appx/manifest/uap/windows10/4", "uap4", and "SupportsMultipleInstances" but have not had any luck figuring why building fails. I have posted numerous questions on MSDN with detailed information, but that turned to be a major waste of time, so, as usual with MS.

My Windows 10 version is 1703, Windows 10 Enterprise, OS Build 15063.413

Visual Studio 2015 Enterprise, Version 14.0.25431.01 Update 3

Below is the error I get

Validation error. error C00CE015: App manifest validation error: 
The app manifest must be valid as per schema: 
Line 31, Column 58, Note: 
The schema for OSMinVersion specified does not recognize XML fields with namespace "http://schemas.microsoft.com/appx/manifest/uap/windows10/4". 
Please ensure that you have the correct OSMinVersion specified. Reason: The attribute '{http://schemas.microsoft.com/appx/manifest/uap/windows10/4}SupportsMultipleInstances' on the element '{http://schemas.microsoft.com/appx/manifest/uap/windows10}AppService' is not defined in the DTD/Schema.   
AppServiceProviderInSeparateBackgroundProcess   C:\Users\myuid\Desktop\work\AppServiceProviderInSeparateBackgroundProcess\AppServiceProviderInSeparateBackgroundProcess\bin\x86\Debug\AppxManifest.xml  

Here is the full Package.appmanifest as created by Blank App (Universal Windows) with added namespace and Extensions tag as suggested by the article

<?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:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
  IgnorableNamespaces="uap mp">

  <Identity
    Name="8db1ab9e-1dff-4fd4-a450-77fadd221043"
    Publisher="CN=username"
    Version="1.0.0.0" />

  <mp:PhoneIdentity PhoneProductId="8db1ab9e-1dff-4fd4-a450-77fadd221043" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

  <Properties>
    <DisplayName>AppServiceProviderInSeparateBackgroundProcess</DisplayName>
    <PublisherDisplayName>username</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="AppServiceProviderInSeparateBackgroundProcess.App">
      <!-- Added Appservice extension that advertises com.Microsoft.Inventory service
           This identifies this app as an app service provider.  The service wil be
           implemented as a background task.
           The app service app exposes the service to other apps.-->
      <Extensions>
        <uap:Extension Category="windows.appService" EntryPoint="MyAppService.Inventory">
          <uap:AppService Name="com.microsoft.inventory" uap4:SupportsMultipleInstances="true"/>
        </uap:Extension>
      </Extensions>
      <uap:VisualElements
        DisplayName="AppServiceProviderInSeparateBackgroundProcess"
        Square150x150Logo="Assets\Square150x150Logo.png"
        Square44x44Logo="Assets\Square44x44Logo.png"
        Description="AppServiceProviderInSeparateBackgroundProcess"
        BackgroundColor="transparent">
        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
        <uap:SplashScreen Image="Assets\SplashScreen.png" />
      </uap:VisualElements>
    </Application>
  </Applications>

  <Capabilities>
    <Capability Name="internetClient" />
  </Capabilities>
</Package>

Version of UWP screenshot is below enter image description here

enter image description here

Windows 10 SDK enter image description here

pixel
  • 9,653
  • 16
  • 82
  • 149

1 Answers1

3

The problem is that you need to use Visual Studio 2017 and target build 15063 or higher to use the uap4-namespaced attribute.

Peter Torr - MSFT
  • 11,824
  • 3
  • 18
  • 51
  • Thanks Peter. Someone should update that document, it is specifically saying to use VS2015 and it provides zero info about that namespace / uap4 / SupportsMultipleInstance. The page is dated just couple of months ago. And btw, I have seen other MS pages talking about this and referencing even wrong namespace. Kinda sad – pixel Jul 20 '17 at 01:16
  • 1
    I made suggested edits to the page and hopefully it will be approved soon. Thanks for bringing this to our attention. – Peter Torr - MSFT Jul 20 '17 at 02:49
  • Thanks Peter, another one I reported at https://stackoverflow.com/questions/45205792/visual-studio-2015-enterprise-reports-internet-connectivity-issue-while-there-is – pixel Jul 20 '17 at 05:23
  • 1
    Also, take a look at this link, it reports completelly different namespace requirement than the link discussing same subject I posted in this so https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-backgroundtasks. Here it says required namespace is http://schemas.microsoft.com/appx/manifest/foundation/windows10 whereas the link you requested to be updates says it is http://schemas.microsoft.com/appx/manifest/foundation/windows10/4 – pixel Jul 20 '17 at 06:02