Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xaml Internal Error error WMC9999

I was working on a resw file to enter my uwp app strings but after I finished the resw file when i wanted to build app it shows me the error that listed above :

C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(264,5): Xaml Internal Error error WMC9999: Data at the root level is invalid. Line 1, position 1.

after I excluded the file but it still shows this error ! What is this error & why i get this ?

like image 273
Amir Esmaeili Avatar asked Sep 17 '16 15:09

Amir Esmaeili


3 Answers

This issue can be replicated referencing C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xaml.dll

I've had the same problem, I don't know if my solution is applicable for all situations:

Look for System.Xaml.dll in you references and remove it

enter image description here

This reference was added by VS without reason (I think)

Clean, rebuild and run your project.

If you get this error:

CSC : error CS5001

Just follow this tutorial by Marius Bancila

like image 51
rubStackOverflow Avatar answered Nov 19 '22 04:11

rubStackOverflow


I noticed the same "WMC9999" error reported in the output window: "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(264,5): Xaml Internal Error error WMC9999: Index (zero based) must be greater than or equal to zero and less than the size of the argument list."

It turned out to be a silly copy-and-paste mistake in the XAML. Notably, instead of being:

<Page x:Class="MyAppNamespace" ...

it was:

<Page x:Class="namespace MyAppNamespace" ...

(I just pasted the "namespace" keyword in the x:Class attribute's value, followed by a space). To solve the problem, just ensure that your XAML is correct!

Hope this can help...

like image 1
Starnuto di topo Avatar answered Nov 19 '22 05:11

Starnuto di topo


If you're developing UWP and meet this error, it can be a mistake of referencing System.Windows.Form (somehow by automatically correcting Alt-Enter is root-evil). Remove this from your references list and build your solution again.

like image 1
Brian Ng Avatar answered Nov 19 '22 03:11

Brian Ng