Top "Nullreferenceexception" questions

The .NET exception that is thrown when there is an attempt to reference (or use) a null or uninitialized object.

How to fix "Object reference not set to an instance of an object" error in Orchard CMS

I'm building an orchard CMS site. Initially, I downloaded the zipped version, but VS complained of the error: "Object reference …

nullreferenceexception orchardcms
When would SqlCommand.ExecuteReader() return null?

When using calling the SqlCommand.ExecuteReader() method, ReSharper tells me I have a possible NullReference exception when I use the …

.net resharper nullreferenceexception sqlcommand
GetAdornerLayer mysteriously returning null

I've been using the same bit of code for several versions of my app with no problems, but I'm now …

c# wpf nullreferenceexception adorner adornerlayer
Why does ResourceManager.GetResourceSet return null on the first request after a build? (C#)

I'm working on a large-ish web application built in C# (asp.net). I've got a simple aspx page that serves …

c# asp.net nullreferenceexception resourcemanager
string.IsNullOrEmpty() Doesn't Seem to Work on a String within a Class within a Class

First off, I think I know what's going on, but I thought I'd bring this issue up here for some …

c# .net string nullreferenceexception isnullorempty
SignInManager.PasswordSignInAsync Throwing Null Object Exception

AccountController.cs houses the AccountController class. The Login method of that class is failing. Specifically, var result = await SignInManager.PasswordSignInAsync( …

c# asp.net-mvc asp.net-mvc-5 nullreferenceexception owin
MySQL with Entity Framework - what am I doing wrong?

I am completely new to Entity Framework and even ADO.NET in general (don't typically do much work with databases). …

.net mysql entity-framework visual-studio-2010 nullreferenceexception
Why does setting ComboBox.SelectedValue to null cause a ArgumentNullException?

Why does setting the SelectedValue of a ComboBox to null cause an ArgumentNullException? The Exception only occurs if the ComboBox …

c# winforms combobox datasource nullreferenceexception
Why would finding a type's initializer throw a NullReferenceException?

This has got me stumped. I was trying to optimize some tests for Noda Time, where we have some type …

.net reflection nullreferenceexception .net-4.5 typeinitializer