Questions tagged [nullreferenceexception]

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

575 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13votes
0answers
571views

SAP Sybase SQL Anywhere NullReference Exception when openening and closing many connections in a service

Currently I've the problem, that SAP Sybase SQL Anywhere throws randomly NullReference Exceptions in a service, which executes a lot of sql queries. The conenctions are always created in a using block ...
user avatar
  • 17.8k
6votes
2answers
1kviews

Xamarin Android.FormsAppCompatActivity NullReferenceException on Startup

I stripped down my application as much as possible to find this problem. Still it appears: 11-12 15:56:27.908 I/MonoDroid(17629): System.NullReferenceException: Object reference not set to an ...
user avatar
  • 387
5votes
0answers
239views

WPF: NullReferenceException at Automation.Peers.ItemAutomationPeer.GetNameCore

I have a vexed problem and have spent a whole day for it, but still can't fix it. I have a button on WPF UI,it is used to add a item to treeview, the code in xaml is below: <Button Content="Create ...
user avatar
  • 215
4votes
1answer
2kviews

Unity Vuforia NullReferenceException

I am using Untiy to build an AR-App for the HoloLens using Vuforia. I'm using a marker to place several objects in reference to the markers position. Nothing spectectular. No scripts written yet. The ...
user avatar
  • 43
4votes
1answer
580views

Avoid crash on NullReferenceException in StyleHelper.OnBindingValueInTemplateChanged

My application had crashed several times with the following stack trace: An uncatched exception was thrown by application: System.NullReferenceException: Object reference not set to an instance of an ...
user avatar
3votes
0answers
788views

Xamarin Forms - Droid: Custom Picker's Dialog causing Exception: Object reference not set to an instance of an object

Background Description I am developing a cross platform mobile application using Visual Studio for Mac. The Xamarin.Forms version of the project is 3.1.0.583944 (which is the latest available). For ...
user avatar
3votes
0answers
2kviews

Why does my Xamarin.iOS app always throw its null exceptions at the Application class level?

Problem If there's a null exception somewhere in my code (or a variety of exceptions), instead of being thrown where the null reference actually happened, Visual Studio pauses the code here instead: ...
user avatar
  • 397
3votes
0answers
1kviews

NullReferenceException from an impossible place?

I want to know if anyone have ever encounter the same situation with me, that a NullReferenceException occurred from a place which is impossible. Here's the exact same code piece that throws the ...
user avatar
  • 4,791
3votes
0answers
472views

Why would dropping down a populated combo box crash a form?

I've got a pair of comboboxes that are populated like so: private void PopulateDeptCombox() { try { ExceptionLoggingService.Instance.WriteLog("Reached FrmInventory.PopulateDeptCombox")...
user avatar
3votes
2answers
668views

Remove a ScreenSpaceLines3D Object from a ViewPort?

I am making a 3D Game with WPF in VB, and I am using a ScrennSpaceLines3D Object I found http://3dtools.codeplex.com/releases/view/2058 but when I try to remove a line I added to the viewport by ...
user avatar
3votes
1answer
2kviews

SharePoint 2013, custom IHttpModule NullReferenceException

Update: Problem solved. Read on. Any idea why it's apparently not possible anymore to add custom IHttpModules? My question is related to: HttpModule.Init - safely add HttpApplication.BeginRequest ...
user avatar
  • 2,673
3votes
0answers
142views

NullReferenceException in ServiceStack's HandleResponseError on request timeout

we are using the latest source code of ServiceStack.Common for a request that can and may exceed the server timeout. Whenever this happens I expect JsonServiceClient.PostAsync to invoke the onError ...
user avatar
  • 301
3votes
1answer
621views

Debugging NullReference exception from WCF client internals

We have a WCF service and roughly the following client code: bool success = false; IClientChannel proxy = null; try { var client = channelFactory.CreateChannel(new EndpointAddress(url)); proxy = ...
user avatar
3votes
1answer
1kviews

Method throws null reference exception after returning non-null value

I have a service method that very simply gets the information for all stores in the database. It maps the stores from EF using Auto Mapper, and returns a generic response of type StoreDTO (a simple ...
user avatar
3votes
0answers
2kviews

NullReferenceException during Measure in WPF

I'm getting a NullReferenceException thrown out of the bowels of WPF during a measure cycle. When the application gets into this state, it usually just starts throwing this exception until the app ...
user avatar
3votes
0answers
162views

How to use PortMode.OptimizedSingleReissueReceiver in an Interleave? (Microsoft CCR)

I have read a post on the Microsoft CCR forum on reducing the overhead of calls to Port.Post() [ref.: PortElement Instantiation in the CCR] and I was wondering if there is a similar way to bind a port ...
user avatar
  • 597
3votes
0answers
1kviews

DataView NullReferenceException in OnListChanged

I have a fairly complex WinForms app that uses data binding to tie strongly typed DataTables to controls (not sure if this fact matters here). An exception gets raised when a change to a column ...
user avatar
  • 1,451
2votes
1answer
60views

Object reference not set to an instance of an object in line of Layout in View

I am gonna be crazy about this error! I have a very simple View, without any model or..., and I receive null error in the line of defining Layout, while in the other pages layout works correctly, any ...
user avatar
  • 123
2votes
1answer
96views

NullReferenceException when generating Microsoft fakes preventing compilation

I have a unit test project that uses Fakes and building it fails but without generating any errors or warnings. The build output shows 0 Errors and 0 Warnings when set to Normal verbosity: 1>Build ...
user avatar
2votes
0answers
714views

What's Wrong with my DI? - Dependency Injection, Unity - Null Reference Only After Injection

I'm new to Dependency Injection and I have been doing my research for a few days now but can't seem to find answers; there is not a whole lot of examples out there specific to zenject so I have been ...
user avatar
2votes
1answer
651views

NullReferenceException Thrown from Oracle.DataAccess.dll

I am having a problem using Oracle Data Provider with .NET . I am using an array of a User-Defined Objects as an IN parameter to a stored procedure. I have added the database schema to Visual Studio ...
user avatar
2votes
0answers
160views

Xamarin.Forms: NullReferenceException using FreshMvvm's modal Pop methods

I'm experiencing an error everytime I try to use FreshMvvm and the modal Pop methods (Android and UWP). Here is what I use: Coming from a MasterDetail View I press "Open" to start a modal dialog (in ...
user avatar
  • 373
2votes
0answers
321views

Error occurs when using connection string inside windows form user control

Need connect to the database and get some values inside the Load event of my user controller. But I'm getting a null reference error when every time I drag and drop my user control to a windows form. ...
user avatar
2votes
0answers
1kviews

Random NullReferenceException on Asp.Net Core 2.1.1 View

I have an Asp.Net Core web site with a view that is bound to a simple view model. .NET Framework 4.6.1 Microsoft.AspNetCore 2.1.1 For the majority of requests it works as expected. Randomly (...
user avatar
  • 382
2votes
0answers
819views

Android.app.Notification.extras null

So I am confused and I don't know how to fix the error crashlytics and google playstore keep saying my users are having. Here is my code: if (event.getEventType() == AccessibilityEvent....
user avatar
2votes
1answer
2kviews

Why is my DTO Null?

I have a few DTOs in a project I am working on. I am using AutoMapper to create the mappings. All of the mappings work except for one of them. I can tell because when retrieving data using LINQ Method ...
user avatar
  • 648
2votes
0answers
132views

Memory management error with Mono?

I have a program that was developed with C#/.NET 4.5.2 and runs fine on Windows (7 x64). The program handles a large amount of data, so it is compiled for x64 only. My largest input dataset can be ...
user avatar
  • 7,485
2votes
0answers
711views

Race Condition in Entity Framework

I am the only developer at a small business, and I have inherited some legacy code in an asp.net mvc application that basically "reroutes" an entity from one business department to another. The main ...
user avatar
  • 21
2votes
1answer
41views

nodejs+Q promises: no Reference Exception in the fulfillment handle

I'm new to nodejs, trying to write first larger project. Unfortunately I'm stuck with nodejs exits with no error when I made a mistake inside Q fullfilment handle. Example: var Q = require('q'); ...
user avatar
2votes
1answer
1kviews

NullReferenceException with MySQL connection

This is going to drive me crazy. I built a simple web app for use on the intranet, it was working fine during local testing. When I deployed it onto the IIS server, it was giving me issues, which we ...
user avatar
  • 57
2votes
0answers
2kviews

DOCX SetColumnWidth null reference exception table insert

Getting a null reference exception and a break on t.SetColumnWidth(i, 0.83);. I want to insert a Table at a specified point and set the column widths. What's wrong with my code, I'm using the DOCX ...
user avatar
2votes
0answers
79views

I'd like to make sense of a JS nullreference exception

An exception occurred several times inside the following function, running in the (Chrome) browsers of our users. NB the code is minified, I've just added newlines for readabilily. function a(c, b, ...
user avatar
  • 5,087
2votes
1answer
5kviews

Oracle.DataAccess.Client.OracleConnection.Open() throws NullReferenceException

I have two separate projects within a solution. They both require creating connections to the same database. However, for some reason the connection opens properly in one project, but doesn't in the ...
user avatar
  • 2,199
2votes
0answers
225views

SystemNullReferenceException in designer for a WPF project in Visual Studio 2015 Update 1

It was working fine before Update 1. What's wrong with my setup or update 1? Additional info: I do have an HP machine but without any environment variable: "Platform". (I say that because of this ...
user avatar
  • 9,963
2votes
1answer
1kviews

Tracking the root cause of Invalid Pointer exception on Window Universal app targeting Windows Phone

To give you some background this is a C# Windows Universal app, which was initially developed for the Windows Tablet but with Windows Phone in mind, at a later date. The time has come and we are ...
user avatar
  • 21
2votes
2answers
2kviews

C#. System.NullReferenceException thrown after running MSTest tests

I am using ReSharper tool to run my MSTest tests, but this exception is thrown: Test method ApiTest.Tests.RestCountriesTests.GetCountriesByCode threw exception: System.NullReferenceException: ...
user avatar
  • 717
2votes
0answers
225views

Exception in System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage()

We're catching the following exception from the field in our .NET4 Windows application. The stack trace doesn't point us to a code location in our app and we don't know how to reproduce the problem. ...
user avatar
2votes
0answers
281views

NullReferenceException thrown on Application.Restart()

I have an application that I want to automatically restart after a certain time of the day. I have a timer on the form that ticks every few minutes to see if the time condition is met. If the ...
user avatar
  • 429
2votes
2answers
250views

NullReferenceException when reading data from local storage

[edit] I want to clarify that the NullReferenceException does not occur within the posted code, but this code somehow gives back null I'm getting a NullReferenceException when running my application ...
user avatar
2votes
1answer
665views

hdinsight new hiveconnection not working

Im using the hdinsight hadoop locally and after successfully running mapreduce jobs on the hdfs i am trying with hive, unfortunately i am getting errors when running the hive query when creating a ...
user avatar
2votes
0answers
652views

July 2013 AjaxControlToolkit.ToolkitScriptManagerCombiner Errors

Hello we are recieving a few different errors on our surver after we upgraded to the July 2013 version of AjaxControlToolKit. It appears if the users go back to the previous screen and attempt to ...
user avatar
  • 176
2votes
0answers
2kviews

Retrieving data from firebird database 1.5

i have a database from firebird 1.5, with the extension .CDB I need to retrieve the data (SELECT) from this database. I have managed to open the connection with the DB, this is the connection string ...
user avatar
  • 23
2votes
0answers
1kviews

Getting InvalidOperationException during call to GetResponseAsync()?

PREFACE: I know the code excerpt is lengthy but I did't want to leave out a detail that someone else might spot as the cause of the issue. The reason for the somewhat verbose nature of the code and ...
user avatar
2votes
0answers
667views

WPF nullreference exception thrown on Button when value converter in prior Label is in place

TLDR: A Nullreference exception is thrown when XAML parsing any button element when another unrelated element has databinding and value converter. When the buttons are commented out, or the ...
user avatar
  • 1,039
2votes
0answers
2kviews

AutoMapper throwing NullReferenceException when mapping nullable enum to null

I can't seem to figure out why AutoMapper is throwing an exception for this mapping: public class MyDestinationType { public MyCustomEnum? PropName { get; set; } } public enum MyCustomEnum { ...
user avatar
  • 46.1k
2votes
0answers
111views

WP7 MediaHistory.Instance null reference exception

Following the instruction on MSDN about how to integrate my application with Music & Video Hub, I want to set the now playing tile and history tile. Each time I receive TrackEnded event, which ...
user avatar
  • 42.1k
2votes
1answer
3kviews

Null Reference Exception for dynamic ascx User Control

I'm working on a user form in which I'd like to dynamically generate as many secondary phone fields as the user wants (on button click event). I've followed Daniel's dynamic control instantiation on ...
user avatar
  • 21
2votes
0answers
1kviews

Webmethod using HttpContext returns null reference exception

It is a web method running via .asmx page: Quick summary: [WebMethod] Method Name { string Port=HttpContext.Current.Request.ServerVariables["SERVER_PORT"]; if (Port == null || Port == "80" || ...
user avatar
  • 8,275
2votes
1answer
708views

Null reference check required to enumerate a collection inside a reflected assembly?

I'm running into a very strange behavior in C#/.NET 3.5... I am writing a class which hooks into upload pipeline of a content management system. The CMS executes this hook via reflection. For some ...
user avatar
  • 1,660
1vote
1answer
68views

Setting MauiSplashScreen tag on MyMauiProject.csproj with a mp4 file throw null exception from Resizetizer/SkiaSharpBitmapTools, looks hardcoded trash

Setting the MauiSplashScreen tag inside my net6.0 MyMauiProject.csproj pointing to a mp4 file makes it throw a null exception from Resizetizer/SkiaSharpBitmapTools. It looks like hardcoded trash from ...
user avatar
  • 11

15 30 50 per page
1
2 3 4 5
12