问题
I'm using Visual Studio 2015 Community.
So, I created a blank UW App (C++) and I wanted to start looking around, because that's my first time using the XAML Designer.
However, with no changes to the code whatsoever, the designer won't load. The Designer returns an unhandled exception (System.NullReferenceException) - Object reference not set to an instance of an object.
This is really weird, as the app compiles and runs fine. The designer gives me a fix ("Excluding project code from running in the design view can improve the stability of the XAML designer...."), but this doesn't resolve the issue.
Anyone know whats the problem there? Thanks!
回答1:
Can you try creating a UWP C# project and F5? After this try opening your C++ XAML Designer again and it should fix the designer.
回答2:
You're probably using static resources or theme resources (for brushes or something like that) that aren't used by Windows 10 UAPs. Try removing the static resources from your XAML files and see if your app works.
回答3:
This worked for me: go to Environment Variables and look for Platform HPD. Delete it.
来源:https://stackoverflow.com/questions/31735912/xaml-designer-crashes-object-reference-not-set-to-an-instance-of-an-object