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

ASP.NET CORE: IConfiguration can not access ConnectionString inside Class Library

I have a class library for a Repository to handle the Database operation, and I tried to create DbContext and set ConnectionString as well, but it did not work. namespace CoreCrud.Repository { public class CoreCrudDBContext:…
pl-jay
  • 970
  • 1
  • 16
  • 33
0
votes
1 answer

Why I can't remove image in canvas WPF C#?

I have my class in Anobject.cs file: public class AnObject { public string Name { get; set; } public int? X { get; set; } public int? Y { get; set; } public AnObject(string name = null, int? x = null, int? y = null) { …
0
votes
0 answers

ArgumentNullException when using custom WinForms control in a form

I am creating a custom WinForms control, containing a DataGridView and some buttons. I have two projects in a solution, one for the control, and one is a test application with a single form containing this control. The control is called…
Al2110
  • 566
  • 9
  • 25
0
votes
3 answers

Syncfusion Datagrid crashes Xamarin IOS application due to initiallising of control

I have a Xamarin application in which I have included the Syncfusion Datagrid control. I am trying to deploy this to an IOS simulator in visual studio. I have added the NuGet package and included a community license. However, it wasn't displaying on…
0
votes
1 answer

asp.net mvc 4.6 dropdownlist give "System.ArgumentNullException: 'Value cannot be null. Parameter name: items' " Error

I tried MVC model to have a Store Procedure, Class, API controller, CreateController and Create View. For some reason, when I try to use the Dropdownlist, it have error and point to the View System.ArgumentNullException: 'Value cannot be…
0
votes
2 answers

How to manage NullReferenceException?

I want to make a form that user have to fill out it. But I'm getting an error. Model: public UserReport Input; [Key] //[Required] public string ReportID { get; set; } [Required] public string Description { get; set;…
0
votes
3 answers

xamarin forms: System.ArgumentNullException has been thrown (IOS)

I am using webview for parsing my HTML data. For this, I am using a custom render. In the Main Project: public class MyWebView : WebView { public static readonly BindableProperty UrlProperty = BindableProperty.Create( propertyName: "Url", …
Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105
0
votes
1 answer

Xamarin Forms: Custom webview is not working in IOS

I am using Custom Webview for solving ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs. and parsing HTML data. My Code: MyWebView.cs using Xamarin.Forms; namespace CustomWebview { public…
Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105
0
votes
0 answers

System.ArgumentNullException: 'Value cannot be null. Parameter name: source' On my code

I tended to copy this code from a tutorial and fix it on my database tables however i keep on getting a thrown exception which is the one mentioned above.. i tried adding data source, didnt work. Here's my Controller method: public…
0
votes
1 answer

Selenium - System.ArgumentNullException: text cannot be null Parameter name: text

When I am trying to run the code then I get this error "System.ArgumentNullException: text cannot be null Parameter name: text" it doesn't pull the data from excel file; can anyone please give me the suggestion that how to fix this issue? here is…
0
votes
2 answers

Working around an ArgumentNullException

I'm trying to return the five most recent articles from my database so I can put links to them in some secondary navigation I have on my index page. I've divided up my MVC project into two sub-projects, based on Steven Sanderson's suggestion in his…
Major Productions
  • 5,914
  • 13
  • 70
  • 149
0
votes
1 answer

DropDownList with foreignkey model c#

I have a model with a foreignkey to another models. From this foreignkey, i want to show into my form a DropDownList with the name of my second models. When i go to create.cshtml or edit.cshtml i have the following error: ArgumentNullException:…
0
votes
1 answer

ArgumentNullException/PlatformNotSupportedException from mscorlib only in debugger

I have been seeing a pair of exceptions when debugging (VS 2015) which occur when clicking in a Textbox. They do not always occur but they always seem to occur under the same circumstances (I can't find a pattern which would explain it). They also…
Les N
  • 11
  • 4
0
votes
0 answers

ArgumentNullException in custom IQueryProvider

At first some background for understanding why I try to create a custom IQueryProvider: I'm looking for a solution for a generic OData client that supports IQueryable. I don't want to use the OData client code generator (because I do not want to…
0
votes
1 answer

Exception to throw when the internals of an Argument are invalid

I have asked myself this many times, but until this day I have not found a good answer. What is the correct exception to throw, if you realize there is an invalid state in the argument that has passed to your method, e.g. if I need to make sure a…