Lochness Monster
Lochness Monster

Reputation: 125

System.ArgumentNullException error with MonoDevelop compiling a c# code

I have another simple question. I have a C# program written as a .cs file. MonoDevelop (improved by Xamarin) managed to build this project. However, when I try to run it, I get the error:

System.ArgumentNullException: Argument cannot be null.
Parameter name: s
  at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider)[0x00012] in /private/tmp/monobuild/build/BUILD/mono- 2.10.9/mcs/class/corlib/System/Double.cs:229
  at System.Double.Parse (System.String s) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Double.cs:200
  at SampleNamespace.SampleClass.Main () [0x00049] in /Users/ninakuklisova/ThoughtWorks/Sales Taxes with inputs.cs:42

which points to the following line of the code:

values[ItemNumber,2] = Double.Parse(quant);

What I find mysterious is that there is no /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/ folder on my Mac, and when I compiled this code on online compilers, all went well. Do you know what could be wrong?

Thank you very much!

Upvotes: 0

Views: 941

Answers (2)

Lochness Monster
Lochness Monster

Reputation: 125

Yes, it was that simple: just don't mention column 2 before column 1. I guess most people won't do it anyways.

Upvotes: 0

Mike Caron
Mike Caron

Reputation: 14561

  1. That folder probably existed on the machine of whoever compiled mono.

  2. Check to see if quant is null.

Upvotes: 2

Related Questions