Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [nullreferenceexception]

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

nullreferenceexception
1 vote
2 answers
16 views

Layout Cascading Parameter is null inside pages - Blazor Server

I am trying to pass the layout as a cascaded parameter to the page that uses the layout. The issue I am facing is that the layout cascaded parameter in the page is always null. Here is the code I am ...
Ahmed H. Sharafeldin's user avatar
-2 votes
0 answers
39 views

System.NullReferenceException at a TextBox Widget without the possibility of being null [duplicate]

I just want to save a normal TextBox widget to another variable, so as soon as the error occurs System.NullReferenceException: “The object reference was not set to an object instance.” you can even ...
susmi's user avatar
  • 13
0 votes
0 answers
31 views

I don't know how to fix this NullReferenceException in C# [duplicate]

I'm programming a Text Adventure RPG in C# for a university project and it's due on Sunday. Now i've encountered this fatal exception that doesnt let me even execute the program. class Program { ...
Manurk Kurogane's user avatar
1 vote
0 answers
36 views

A non-null variable results me to NullReferenceException [Unity] [duplicate]

I've been on Unity for a very long time, yet I've come across the most common error. I made a script to create a ship components store from a list of ScriptableObjects. Here's the ScriptableObjects: ...
I'm Gogole's user avatar
2 votes
1 answer
53 views

Why is object array null later in the script even after confirming its not null after initialization

The title. there are no mentions of the spriterenderers or array anywhere else in the program SpriteRenderer[,] Renderer = new SpriteRenderer[8,8]; void Awake() { if (D) { ...
Tyler Levy's user avatar
0 votes
1 answer
48 views

Application runs perfectly in Visual Studio, yet when the executable runs it throws NullReferenceException. File reading issue?

I have written a C# application in Visual Studio (using Avalonia, irrelevant for this question). It runs perfectly in Visual Studio, yet when I try and run the executable, it throws a ...
Lito Bezos's user avatar
0 votes
0 answers
48 views

NullPointerException: Attempt to invoke virtual method 'long SecuGen.Driver.SmartCapture3Fdu05.Start(int, boolean)' on a null object reference

I developed an application for **android **where i am getting Finger Print using **SecuGen **Pro 20 device. Samsung device capture the finger print image. But other device can not capture image (such ...
F. Rahman's user avatar
1 vote
0 answers
86 views

How to fix Image variable that is null during playtesting?

So currently I’m making inventory functions for my Michael game. I was making a script called RespawnItem. public class RespawnItem : MonoBehaviour { //----PUBLICS----// public PlayerCollectingSystem ...
Teyonna Butler's user avatar
0 votes
0 answers
20 views

System.NullReferenceException: 'Object reference not set to an instance of an object.' System.Web.Mvc.WebViewPage<TModel>.Model.get returned null [duplicate]

I'm working on a project (ASP.NET MVC5) for school but today I ran into this error even the same code yesterday is exactly like this 100% but still ran and today when i open it again it run to error. ...
Vu Ba Luc's user avatar
0 votes
0 answers
29 views

NullReferenceException on ldarg.1 instruction [duplicate]

We have a C#/.NET application running as a Windows Service. Infrequently, it logs several entries of the following form in the Windows Event Viewer. Log Name: Application Source: Windows Error ...
A.M.'s user avatar
  • 44
0 votes
1 answer
42 views

nullreferenceexception from ExecuteScalar()

I really don't know what to write here. I was just coding and this stuff happened. connection.Open(); SqlCommand cmd = connection.CreateCommand(); cmd.CommandText = "select count(*) from ...
Unseens's user avatar
0 votes
0 answers
50 views

WinForms: Reference to UserControl returns null, Forms designer adds bad code to InitializeComponent method

In this class library, there are several UserControls that get loaded and unloaded from a container Panel depending on what functionality is required. These UserControls contain docked panels that ...
CrackingWise's user avatar
0 votes
0 answers
35 views

ListView.Items(0),Selected error System.nullreferenceexception

I'm trying to debug a program which uses a ListView to create a list of icons for files stored in a DB. I got the log of an exception stating System.nullreferenceexception: 'object reference not set ...
grimoiredark's user avatar
0 votes
0 answers
91 views

Mocking method that returns IAsyncEnumerable throws null reference exception

I'm using .NET 8, NSubstitute, NUnit.Framework. I'm trying to mock a method that returns IAsyncEnumerable. When I'm trying to mock this method with other conditions, I'm getting null reference ...
Amir M's user avatar
  • 538
0 votes
0 answers
20 views

c# DB command throwing NullReferenceException on line ** DbDataReader reader = command.ExecuteReader();** [duplicate]

In my given c# DB command throwing NullReferenceException on line ** DbDataReader reader = command.ExecuteReader();** please review my code and offer me solution public List<Dictionary<string, ...
laila tul badar's user avatar

15 30 50 per page
1
2 3 4 5
186