Questions tagged [argumentnullexception]

[MSDN] The exception that is thrown when a null reference is passed to a method that does not accept it as a valid argument.

MSDN ArgumentNullException is thrown when a method is invoked and at least one of the passed arguments is null but should never be null.

ArgumentNullException behaves identically to ArgumentException. It is provided so that application code can differentiate between exceptions caused by null arguments and exceptions caused by arguments that are not null. For errors caused by arguments that are not null, see ArgumentOutOfRangeException.

ArgumentNullException uses the HRESULT E_POINTER, which has the value 0x80004003.

For a list of initial property values for an instance of ArgumentNullException, see the ArgumentNullException constructors.

166 questions
-1
votes
1 answer

Uncatchable NullException on some URLs with DownloadString

Is this is a bug in Visual Studio 2015 or? Exception Exception thrown: 'System.ArgumentNullException' in mscorlib.dll ("Value cannot be null.") System.ArgumentNullException The code/tutorial I was…
user576820
  • 1,289
  • 2
  • 11
  • 13
-1
votes
1 answer

Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

I'm trying to get some data from a xml document using XmlPullParser. When i'm trying to run the application is crushing due to a null object reference. The code and the error are below, but i don't see any problem with the code. public List
Ionut Harcau
  • 11
  • 1
  • 1
-1
votes
2 answers

Null Exception of array: not initialising from Oracle database

I have connected my Visual studio 2013 to Oracle XE 11 Database. I'm trying to retrieve information from the tables I have in the database using the following code, but it seems that the array decor isn't getting initialised with the values I'm…
-1
votes
1 answer

threadid=1: thread exiting with uncaught exception (NullPointerException)

I need some help to finish my workhome, I have a app on Android with a WebService, the method List servicos = new ServicoReq().getListaServicos(); is working fine, i'm trying compile this code bellow, : public class ConsultaServicos…
-1
votes
4 answers

passing an empty string as Directory parameter

I was wandering if you can help with this. I have a console app which takes a string Directory as input. I want to put in a check in place which allows me to check if a user puts in an empty string I want the system to log an error such as…
Jetnor
  • 521
  • 2
  • 11
  • 26
-1
votes
1 answer

ArgumentNull exception in asp.net web application

I have developed an asp.net application in which input will be given through an excel sheet. This application is working fine in a system with WINDOWS XP and MS office 2008. If i try to run the same application in a system with WINDOWS 7 and MS…
raji
  • 65
  • 1
  • 2
  • 9
-2
votes
2 answers

StreamReader reads null in while loop

Using this method I am looping through a file removing lines with a 'T' in them and storing them to a list. At the end of the loop it should exit, however it reads the null value and continues to pass it throwing an exception with…
-2
votes
1 answer

NullPointerException when i run my project

i have a problem with my code, this is error java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setImageResource(int)' on a null object reference there is no error in code, but when run there is a…
-2
votes
1 answer

How to debug a "'System.ArgumentNullException' occurred in System.Core.dll but was not handled in user code"

I'm new to C# and a bit baffled by this, mainly because everything has worked perfectly with this web app for the last several months, and this issue just started, seemingly with no changes having been made to the code in months. I've read several…
Stpete111
  • 3,109
  • 4
  • 34
  • 74
-2
votes
1 answer

VB.net Null error

Im having an issue trying to handle a ArgumentNullExeption occured value cant be Null paramiter name item So far ive tried the following Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click …
shaggs
  • 600
  • 7
  • 27
-2
votes
1 answer

Null Reference on adding to database in mvc

I encountered a null exeception when i tried using this method and i dont know what is wrong. Your help will be of great assistance thanks. HttpPost [HttpPost] public ActionResult AddConsultation(Consultation _conmodel, int PatientId,…
-2
votes
3 answers

Cannot increment integer inside the foreach loop

I have a C# method to convert from a list into an array. The code goes like this: public String[] ConvertToArray(List list) { String[] Array = null; Int32 i = 0; foreach (var item in…
user2701646
  • 139
  • 4
  • 4
  • 20
-2
votes
1 answer

Convert.ToString occurs an NRE

http://turcguide.com/stack/nre1.jpg When I use and user defined object such in my exemple mytext[i].text i get an NullReferenceException but if i use a design time object there is no NullReferenceException In my exemple, the line below does not give…
Ismail Gunes
  • 548
  • 1
  • 9
  • 24
-3
votes
1 answer

Why am I having a pop up in Visual Studio saying System ArgumentNullExpection has been thrown?

I am trying to run some code, it worked smoothly before, but now it says System.ArgumentNullExpection has been thrown. I have tried running the code but that message now always appears Console.Write("Mata in antal mjökpaket som är kvar: "); …
Tony Tech
  • 11
  • 3
-3
votes
2 answers

WPF Designer : System.ArgumentNullException

First of all, sorry for my bad english. I post here because I know some people have very relevant answers. I've been working on a WPF application for several months without any problem. Since this morning, everytime I try to click, update or resize…
Chostakovitch
  • 965
  • 1
  • 9
  • 33
1 2 3
11
12