question

zipswich avatar image
0 Votes"
zipswich asked zipswich commented

Element '{http://schemas.microsoft.com/appx/developer/windowsTemplateStudio}Metadata' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Package

A UWP app worked fine for a number of years. When I tried to build it today, I got error:

 error APPX0501: Validation error. error C00CE014: App manifest validation error: The app manifest must be valid as per schema: Line 57, Column 4, Note: The schema for MaxVersionTested specified does not recognize XML fields with namespace "http://schemas.microsoft.com/appx/developer/windowsTemplateStudio". Please ensure that you have the correct MaxVersionTested specified. Reason: Element '{http://schemas.microsoft.com/appx/developer/windowsTemplateStudio}Metadata' is unexpected according to content model of parent element '{http://schemas.microsoft.com/appx/manifest/foundation/windows10}Package'.

I think the problematic code is the following:

   <Metadata xmlns="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio">
     <Item Name="generator" Value="Windows Template Studio" />
     <Item Name="projectType" Value="Blank" />
     <Item Name="framework" Value="MVVMBasic" />
     <Item Name="platform" Value="Uwp" />
   </Metadata>

It was generated automatically when the project was created.

Could anyone offer a tip on how to fix this?

I wonder if this is related to the recent VS2019 update. I am using VS Version 16.10.1.


windows-uwp
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Derive from error info, it contains error Line number, can you share the that line information?

0 Votes 0 ·

Please try recreate blank app with window template studio. and check if project template works well.

0 Votes 0 ·

I added xmlns:genTemplate="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio" to the following and modified IgnorableNamespaces accordingly:


0 Votes 0 ·
 <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:genTemplate="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio" IgnorableNamespaces="uap mp genTemplate">

Then modified Metadata tag:

   <genTemplate:Metadata xmlns="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio">
     <Item Name="generator" Value="Windows Template Studio" />
     <Item Name="projectType" Value="Blank" />
     <Item Name="framework" Value="MVVMBasic" />
     <Item Name="platform" Value="Uwp" />
   </genTemplate:Metadata>

It is working fine now.
I never manually edited the file before and the app worked fine for a number of years.

0 Votes 0 ·
Show more comments

0 Answers