Exceptions-VBForums
Results 1 to 9 of 9

Thread: Exceptions

  1. #1

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    53

    Exceptions

    I am writing an application for pocket pc using vb.net and at what to me seems like random point in the code (I'm sure it not random) exceptions are generated and logged in the 'immediate window' at the bottom of the screen without a message halting my application.

    Instead all that happens is my application just stops running without any information as to why except the folloiwng messages

    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

    I have tried to debug this and find out why the messages are appearing but seem to be hitting a dead end

    If anyone can come up with the answer before I stumble accross if I would be greatful

  2. #2
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,203

    Re: Exceptions

    This should clear everything up for you
    http://blogs.msdn.com/davidklinems/a...12/438061.aspx
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  3. #3

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    53

    Re: Exceptions

    Thanks for the link, I found some similar as well

    The problem I have is that I get the following list of exceptions when I try and open a connection to the sql mobile database on the pocket pc.

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.SqlServerCe.dll
    A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.SqlServerCe.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

    I never used to get this error. I have since changed version of the sql components on the device from sql server ce to sql mobile 2005. It is not that I get this problem and it is causing me to have problems running my app in any way shape or form

    How could this be caused/fixed now that I am running the latest version of sql mobile?

  4. #4

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    53

    Re: Exceptions

    I think the root of the problem is when I try and execute the following line of code

    VB Code:
    1. reader = command.ExecuteReader(CommandBehavior.CloseConnection)

    It is at this point in the code when I get the following exception

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    I thought this might be something to do with the sqlserverce dll's so I re-installed sql mobile and I cannot register the System.Data.SqlServerCe.dll file

    I get the message saying the the file was loaded by it counldn't find the register server entry point

    Please help :-(

  5. #5
    New Member
    Join Date
    Oct 2006
    Posts
    3

    Re: Exceptions

    Hello !

    I have exactly the same problem. And the line where the problem appears is the same kind :

    rsParametresPDA = CmdSQLPDA.ExecuteReader()

    Strange behaviour...

    Do you have any information ?

    Thank you !!

  6. #6
    Frenzied Member
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,026

    Re: Exceptions

    Read the blog that Kleinma linked to ... and don't panic

  7. #7
    New Member
    Join Date
    Oct 2006
    Posts
    3

    Re: Exceptions

    Quote Originally Posted by Merrion
    Read the blog that Kleinma linked to ... and don't panic
    I do agree, but when I read this :

    Does a first chance exception mean there is a problem in my code?
    First chance exception messages most often do not mean there is a problem in the code. For applications / components which handle exceptions gracefully, first chance exception messages let the developer know that an exceptional situation was encountered and was handled.

    For code without exception handling, the debugger will receive a second chance exception notification and will stop with a unhandled exception.

    Take care!
    I wonder : I do not have exeption handling for this code, and no second chance exception appears...

    And the "exceptional" situation always appears... not very exceptional...

    The error is :

    Une exception de première chance de type 'System.IO.FileNotFoundException' s'est produite dans mscorlib.dll
    If this is not a problem, I abandon my search... !

    Thanx ;-)

  8. #8
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,203

    Re: Exceptions

    you are saying you are getting a first chance exception of that?

    If so, like stated above, don't worry about it. It simply lets YOU the developer know that in some framework method you called (something that is outside the bounds of your actual code) an exception occured, but it was handled with error handling and all is well.
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  9. #9
    New Member
    Join Date
    Oct 2006
    Posts
    3

    Re: Exceptions

    Quote Originally Posted by kleinma
    you are saying you are getting a first chance exception of that?

    If so, like stated above, don't worry about it. It simply lets YOU the developer know that in some framework method you called (something that is outside the bounds of your actual code) an exception occured, but it was handled with error handling and all is well.
    There's an error and all is well...

    Same as BSOD : oh my god, an error... Dont panic, your server is out of service, but the error has been catched by Windows...

    OK, thank you for your help, I will never panic anymore !!
    Last edited by gabor; Oct 3rd, 2006 at 08:40 AM.
    Fabrice, Toulouse, FRANCE
    Using VB.NET 2005/.NET 2.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.