System.NullReferenceException occurs in xaml designer
Asked Answered
O

5

9

I've created a C++ UWP Windows 10 app using Visual Studio 2015. However, I'm not able to visualize any xaml in the designer because I'm always getting a System.NullReferenceException error. How can I fix this?

Odoriferous answered 3/8, 2015 at 13:2 Comment(0)
O
12

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!

Odoriferous answered 3/8, 2015 at 13:2 Comment(7)
Please accept your own answer, if it solves your question. I guess the issue exists due to some packages that only get "installed"/pulled, when you use a C# UWP project?Coleen
It worked for me as well. It is odd but thanks for the tip! :)Giuseppinagiustina
I have the same problem, only the other way around. I want to create a C# universal app, but the designer won't load. I tried your fix in reverse (created a c++ dummy project), but in my case it didn't work. :(Everglades
@Everglades Have you found any way to solve xamldesigner issueCoelenteron
Yep, turned out that an environment variable caused my problem. Here's my question with the accepted answer: #31728669Everglades
This explains what happens: linkArsis
The XAML designer crashing with a NullReferenceException is a known issue/bug with VS 2015 RTM: social.msdn.microsoft.com/Forums/en-US/…Superincumbent
C
1

Switching solution platform to x86 worked for me.

Camboose answered 18/3, 2016 at 20:7 Comment(0)
M
0

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![enter image description here]1

Misspeak answered 5/8, 2015 at 16:59 Comment(0)
B
0

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

Bibliolatry answered 17/7, 2016 at 18:16 Comment(0)
H
-2

This is fixed in Update 1 of Visual Studio 2015

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

Henandchickens answered 4/4, 2016 at 18:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.