Question

I have a C# windows application installed on the client machine. It was running fine, all of a sudden application crashed and when I checked exceptions, I got the following details:

Description: Stopped working

<ProblemSignatures>
<EventType>CLR20r3</EventType>
<Parameter0>myapp.exe</parameter0>
<Parameter1>2.0.13</parameter0>
<Parameter2>529dadac</parameter0>
<Parameter3>mscorlib</parameter0>
<Parameter4>2.0.0.</parameter0>
<Parameter5>5174ddfb</parameter0>
<Parameter6>c43</parameter0>
<Parameter7>59</parameter0>
<Parameter8>System.FormatException</parameter0>

Please give valuable suggestions.

Was it helpful?

Solution

The exception you are getting is :- System.FormatException.
Here is a brief description about it:-

FormatException is thrown when the format of an argument in a method invocation does not match the format of the corresponding formal parameter type. For example, if a method specifies a String parameter consisting of two digits with an embedded period, passing a corresponding string argument containing only two digits to that method would cause FormatException to be thrown. FormatException uses the HRESULT COR_E_FORMAT, which has the value 0x80131537.

If you have a WinForm application, try doing it in you "Program.cs" file:-(default name of the file generated by viusual studio)

  try
  {
      Application.Run(new Form()) ; 
  }
  catch(Exception ex)
  {
     Log(ex) ; 
  }

  void Log(Exception ex)
  {
      string stackTrace = ex.StackTrace ; 
      File.WriteAllText(youFilePathHere, stackTrace) ; // path of file where stack trace will be stored.
  }

By analyzing the stack-trace it will be easy for you to know a lot about the "Run time exception" you are experiencing in your application.(exact line no, method name etc).
Hope it helps!

OTHER TIPS

Difficult to analyse from this.

But, This exception will be thrown when you convert a null value to a meaningful value.

By using Convert function you might have tried to convert null value to other.

You will have to check for null value in your code and then assign it to 0 or any other value as convinience.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top