XAML Designer crashes Object reference not set to an instance of an object

自古美人都是妖i 提交于 2020-01-11 11:41:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!