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:
Imports System.IO public shared sub Main() ' This is where the MissingMethodException is created Process_Files() end sub public shared sub Process_File() Dim fs As New StreamReader("/file.txt") Dim sLine as String = fs.ReadLine() ' if I comment out the Try...Catch the Exception wont be created Try Dim i = Convert.ToInt32(sLine) Catch Console.WriteLine("Invalid File") Return End Try Console.WriteLine(sLine + " x 2 = " + i*2) End Sub




Reply With Quote