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
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Exceptions

    This should clear everything up for you
    http://blogs.msdn.com/davidklinems/a...12/438061.aspx

  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
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    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
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  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
  •  



Click Here to Expand Forum to Full Width