System.NullReferenceException occurs in xaml designer

六月ゝ 毕业季﹏ 提交于 2019-12-01 15:48:27

That's very odd but I solved following these steps:

  1. Close any instance of Visual Studio
  2. Open Visual studio and create a new C# UWP empty project (name it as you like, do not matter)
  3. Run the "useless" created project then close it as Visual Studio
  4. Open again your previous C++ UWP project

In my case everything started working!

Switching solution platform to x86 worked for me.

I'm experiencing exactly the same problem on my primary development machine but not on another. The reason is... I think... When I installed Visual Studio 2015 on the 2nd machine, the first time I created a Universal Solution (C#) I was shown a dialog asking me to OK "elevated permissions" (custom permissions) for the VS2015 installation folder. I OK'd it and Designer works on that machine in both Blend2015 and VS2015 (community edition)

On the other machine I was never shown the dialog asking me to confirm elevated permissions and Designer does NOT work on that machine (VS2015 Enterprise). This machine also has VS2013 update 5) on it.

I am thinking that I might have to completely wipe off VS2015 and try to clean the registry of all VS2105 references AND remove the VS2015 installation directories on C:\ AND when I reinstall, create a installation directory with a different name (if I can). What a PAIN though... I'm waiting to see if MS delivers a simple solution since I'm quite positive that this whole issue boils down to a bug (feature... grrr) having to do with custom permissions that can't be changed (or added) after installation.

Would be nice is MS would confirm this... (please note, none of this involved c++... it was all C#)

Tom

this is the dialog I was shown on the machine where Designer works

]1

Installing the Windows Software Development Kit (SDK) for Windows 10 solved the issue for me. It may ask to unistall the previous version of Windows 10 RTM SDK

https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

This is fixed in Update 1 of Visual Studio 2015

https://www.microsoft.com/en-us/download/details.aspx?id=49989

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