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
vote
0 answers

System.ArgumentNullException: Value cannot be null Parameter name: input

When I run this file I get the following error: Server Error in '/' Application. Value cannot be null. Parameter name: input Description: An unhandled exception occurred during the execution of the current web request. Please review the…
1
vote
3 answers

Need solution for troubled null problem

For a day now i'm stuck with this null problem in my repository. here is my piece of code writen for linq to sql... i've tried a lot of options but no help for this. the problem here is if the vidList got null value, it got stuck right in 3rd…
DucDigital
  • 4,580
  • 9
  • 49
  • 97
1
vote
2 answers

How to implement Dictionary in multiple thread scenario to avoid ArgumentNull Exception?

I am trying to implement the dictionary in multiple thread scenario. In single thread it works fine however in multiple thread scenario i got the ArgumentNull Exception. I have tried using the lock still no luck. Below is the code details of my…
Binod
  • 313
  • 1
  • 2
  • 12
1
vote
1 answer

Value cannot be null, ArgumentNullException

I am currently trying to return an array which contains information about a seat at a theate such as Seat number, Name, Price and Status. I am using a combobox where I want to list all vacant or reserved seats based upon choice. When I choose…
Wooolie
  • 15
  • 2
  • 2
  • 5
1
vote
2 answers

Null Pointer Error Again

So I have this compiler class that compiles some .mjava files but others it fails on and wondering if anyone can help me figure out why. I have two methods that break for two different files. The first consts.mjava file I try to compile is: // demo…
Alpdog14
  • 129
  • 2
  • 14
1
vote
0 answers

"Value cannot be null" when invoking method decorated with [Autocomplete]

I have a Windows Forms application (.NET 3.5) which is deployed with the ClickOnce-technology and is used by approximately 50-100 concurrent users. They all target the same MS SQL database (SQL SERVER 2008 R2) which is hosted externally. The…
1
vote
0 answers

ArgumentNullException on ReadXML

I have a problem with my DataSet serialization to XML file. Every time I try to load the XML, the ReadXML() function throws the ArgumentNullException. What is interesting, this issue occurs only when I load it to the empty dataset. When I fill…
1
vote
1 answer

Spring.Objects.Factory.ObjectCreationException: System.ArgumentNullException: Key cannot be null

This is a long shot... I'm using spring 1.3.2 and at random times I get ArgumentNullException exception (See stack trace below). I'm configuring the container in a mix between XML and Code (by using ObjectDefinitionBuilder directly, no code config).…
Sebastian Piu
  • 7,838
  • 1
  • 32
  • 50
1
vote
2 answers

Troubleshooting background Silverlight exceptions

In my Silverlight 5 app, I'm getting an ArgumentNullException with no useful stacktrace. I simply see: System.ArgumentNullException occurred Message=Value cannot be null. Parameter name: key StackTrace: at…
Arian Kulp
  • 831
  • 8
  • 31
0
votes
3 answers

Collection initialisation using iif() throws ArgumentNullException

Can anyone tell me why this gives an error at run-time: Dim mightBeNothing As List(Of String) = Nothing Dim a As List(Of String) = IIf(mightBeNothing Is Nothing, New List(Of String)(), New List(Of String)(mightBeNothing)) I am getting…
Flash
  • 15,945
  • 13
  • 70
  • 98
0
votes
1 answer

BLToolkit + T4 generation + PostgreSQL database, possible?

want to generate my data layer using bltoolkit, T4 templates and postgreSQL. I receive an exception running my T4 template, based on the one suggested by the documentation: Error 5 Running transformation: System.ArgumentNullException: Value cannot…
0
votes
1 answer

Rest API : Value cannot be null. (Parameter 'text') on GET Method

In my REST Api in .net core, I created a route that returns me for an article code, the description of the article. But if the article does not exist or if the Description column of the article is empty (NULL) then I want my api to return me…
0
votes
0 answers

IFontResolver return buffer null

I'm using PDFSharpCore to create a pdf, when I came across the problem that there are no fonts on my android device (I'm using a physical android device since emulators are not working on my computer), I googled and found this IFontResolver: public…
0
votes
0 answers

System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name' + _ViewStart.cshtml + Razor + C#.Net

Error in _ViewStart.cshtml with DotRez Razor Steps I'm trying debug my app (with IIS Express or IIS) but appear error of ArgumentNullException, but if I open de app only with IIS without attach the app, it open…
Alejandro
  • 23
  • 4
0
votes
2 answers

Best Practices - Is it necessary to check for certain preconditions if another method does so?

Here's an example. I saw a "ReadOnlyDictionary" class online and it had the following code: void ICollection.CopyTo(Array array, int index) { ICollection collection = new List>(this._source); …
michael
  • 14,844
  • 28
  • 89
  • 177