Why the ' ', hexadecimal value 0x0C, is an invalid character. Line 1, position 1. throws in WPF

StackOverflow https://stackoverflow.com/questions/14352651

  •  16-01-2022
  •  | 
  •  

문제

When i load a xxxx.XAML into WPF frame it throws the error ' ', hexadecimal value 0x0C, is an invalid character. Line 1, position 1. how to find which is causing the problem. when the xxxx.XAML is in another project's start page, it works fine, when i load that condent of xxxx.XAML in arother project means it throws an error why this is happening ?

And also i upgrade my project from vs 2010 to vs 2012

도움이 되었습니까?

해결책 2

In my file name, i have upper case X. while reading load the file i use small x. so it cause the problem

다른 팁

In my case it was that I wanted to load a XAML file using the code below, but it's Build Action was set to Page instead of Resource:

Uri uri = new Uri(resourcePath, System.UriKind.Relative);
Stream stream = Application.GetResourceStream(uri).Stream;
UIElement view = (UIElement)XamlReader.Load(stream);
stream.Close();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top