I'm having a very serious problem using Try & Catch in my Pocket PC project.

If I put in any exception catching into my code, when my program comes to call the method containing the Try...Catch it causes a MissingMethodException.

If I take/comment out all of the Try...Catch's the code runs fine, unless a real exception occurs, which is obviously where my delema lies.

If I catch exceptions, my program never works. If I don't, my program sometimes works. Both of which are unacceptable.

a (crap) example:

VB Code:
  1. Imports System.IO
  2.  
  3. public shared sub Main()
  4.     ' This is where the MissingMethodException is created
  5.     Process_Files()
  6. end sub
  7.  
  8. public shared sub Process_File()
  9.  
  10.     Dim fs As New StreamReader("/file.txt")
  11.  
  12.     Dim sLine as String = fs.ReadLine()
  13.     ' if I comment out the Try...Catch the Exception wont be created
  14.     Try
  15.         Dim i = Convert.ToInt32(sLine)
  16.     Catch
  17.         Console.WriteLine("Invalid File")
  18.         Return
  19.     End Try
  20.  
  21.     Console.WriteLine(sLine + " x 2 = " + i*2)
  22.  
  23. End Sub