Top "Nullreferenceexception" questions

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

VB .Net NullReferenceException work-around

This should be simple, but I am having problems. Using the eBay .Net library, sometimes certain fields in a response …

.net vb.net string nullreferenceexception
ReSharper: how to remove "Possible 'System.NullReferenceException'" warning

Here is a piece of code: IUser user = managerUser.GetUserById(UserId); if ( user==null ) throw new Exception(...); Quote quote = new …

c# .net configuration resharper nullreferenceexception
How to handle NullReferenceException in a foreach?

foreach (string s in myField.getChilds()) { if (s == null) //handle null else //handle normal value } When I run my program …

c# foreach nullreferenceexception
GetHashCode on null fields?

How do I deal with null fields in GetHashCode function? Module Module1 Sub Main() Dim c As New Contact Dim …

null nullreferenceexception equality gethashcode iequatable
Always see NullReference exception in designer with all silverlight business applications in visual studio 2010

Starting with the most simple case. If I press "File->new project->silverlight business application" it opens up …

silverlight visual-studio-2010 nullreferenceexception
MVC5 Razor NullReferenceException in Model

For some reason I'm getting a NullReferenceException whenever I try to access my model. Here is the code from my …

c# asp.net-mvc razor asp.net-mvc-5 nullreferenceexception
c# Xunit, Assert.Throws fails when expected exception raised

EDIT: There is a similar question here, but the solutions only suggest workarounds and provide no insights into the cause …

c# unit-testing nullreferenceexception assert xunit.net
VS2012: Property Pages isn't opening: Object reference not set to an instance of an object

I'm on Visual Studio Premium 2012, Version 11.0.50727.1 RTMREL, Windows 7 Enterprise (SP1). When I right click on the Solution, and click Properties, …

visual-studio-2012 projects-and-solutions nullreferenceexception
Visual Studio Cannot open cshtml Files

I have a problem, which I cannot solve. I can't open every cshtml-File in a Visual Studio c# mvc project (…

c# asp.net-mvc visual-studio-2015 nullreferenceexception