locked
Option Strict = ON RRS feed

  • Question

  • User298526969 posted

    Ok to explain this the best I can :)

     At first I had Option Strict set to OFF and got this error

     

    A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll

     

    Then I turned Option Strict On and fixed my errors.

    Now Im debugging to run the program and it works perfectly but now it has that same error as above. Does anyone know the problem?

    Thanks.

    Thursday, June 12, 2008 2:32 AM

All replies

  • User1191518856 posted

    Invalid cast occurs when you do an explicit type conversion that is invalid.

    When the exception is thrown, you usually get a call stack that will indicate where it was thrown. Can you see this?

    Also see Troubleshooting Exceptions: System.InvalidCastException

    Thursday, June 12, 2008 2:59 AM
  • User298526969 posted

    Thanks there was nothing wrong with it. I guess I had to close out of the program and go back in because when I did that, that message didnt show up anymore :)

    Thursday, June 12, 2008 2:16 PM