Exception with System.Drawing.Image
Hi guys I am getting an exception from the following
inner exception: {"The value cannot be empty. \ r \ nParameter: String"}
Which reads as a simple error message, but none of the values ββ(image, fileName) matter. How do I know where this line is?
RipHelper.UploadImage(image, fileName);
which calls
public static void UploadImage(System.Drawing.Image image, string fileName)
{
// this line is never reached
}
Here is the complete error log
#
System.ArgumentNullException: The value cannot be null. Parameter name: String in System.Number.StringToNumber (String str, NumberStyles, NumberBuffer & number, NumberFormatInfo info parameters, Boolean parseDecimal) in System.Number.ParseInt32 (String s, NumberStyles style, NumberFormatInfo info) in System.Int32.Parse ( String s) in Helpers.RipHelper..cctor () in C: \ Helpers \ RipHelper.cs: line 23 --- End of internal check of exception stack --- in Helpers.RipHelper.UploadImage (HttpPostedFile uploadFile, String fileName) in Helpers .UploadHelper.UploadImage (HttpContext context) at C: \ Helpers \ UploadHelper.cs: line 79
source to share
The exception is the static constructor of the Helpers.RipHelper class on line 23 of RipHelper.cs. This line calls Int32.Parse, passing in a null value.
Perhaps the static constructor refers to a static field that hasn't been initialized yet. If you are having trouble debugging this, please post the class code, including the static constructor and any field initializers.
source to share