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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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")...
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 ...
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 ...
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 ...
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 = ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 (...
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....
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 ...
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 ...
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 ...
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');
...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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: ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
{
...
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 ...
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 ...
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" || ...
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 ...
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 ...