By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,959 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,959 IT Pros & Developers. It's quick & easy.

[VB.net] - Dealing with First Chance Exceptions

P: 79
Hi,

Today, i added some new code which was to see if a file is locked or not (in use by another application). While i did that it was showing me some errors like in the Output window:-

Expand|Select|Wrap|Line Numbers
  1. A first chance exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.VisualBasic.dll
  2. A first chance exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.VisualBasic.dll
  3. A first chance exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.VisualBasic.dll
  4. A first chance exception of type 'System.IO.IOException' occurred in Microsoft.VisualBasic.dll
  5. A first chance exception of type 'System.IO.IOException' occurred in Microsoft.VisualBasic.dll
  6. A first chance exception of type 'System.IO.IOException' occurred in Microsoft.VisualBasic.dll
  7. A first chance exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.VisualBasic.dll
Can some help and tell me if this is any serious problem, after searching for a while and reading very confusing articals i couldn't understand if it is or not - if i understand correctly what they meant they said it wasn't important and i should ignore these messages?

Thanks in advance
Regards
Sep 21 '08 #1
Share this Question
Share on Google+
6 Replies


balabaster
Expert 100+
P: 797
Check out this article about first chance exceptions, it may be useful:

http://social.msdn.microsoft.com/For...-f3c840d72b55/
Sep 21 '08 #2

P: 79
Check out this article about first chance exceptions, it may be useful:

http://social.msdn.microsoft.com/For...-f3c840d72b55/
Thanks, it was pretty useful.

I think i understand it alittle but just not sure if i should ignore these..

The post you pointed to sort of makes the same suggestion but says it really depeneds on the application :s i got those exceptions when i was trying to see if a file is opened by trying to write in it or delete it.
Sep 21 '08 #3

balabaster
Expert 100+
P: 797
Thanks, it was pretty useful.

I think i understand it alittle but just not sure if i should ignore these..

The post you pointed to sort of makes the same suggestion but says it really depeneds on the application :s i got those exceptions when i was trying to see if a file is opened by trying to write in it or delete it.
In my experience they can mostly be ignored, but personally I can't stand leaving unhandled exceptions in my code, even if they are outwardly harmless.
Sep 21 '08 #4

P: 79
Thanks :)

Do you think i should i worry about these messages that i am getting then?

They are not unhandled right?


Regards
Sep 23 '08 #5

balabaster
Expert 100+
P: 797
Thanks :)

Do you think i should i worry about these messages that i am getting then?

They are not unhandled right?


Regards
Well theoretically, they occur because you have a method that throws an exception that may or may not be handled. It is a second chance exception that causes your application to crash. So you will always encounter first chance exceptions - if you are handling them, you can ignore them.
Sep 24 '08 #6

P: 79
Well theoretically, they occur because you have a method that throws an exception that may or may not be handled. It is a second chance exception that causes your application to crash. So you will always encounter first chance exceptions - if you are handling them, you can ignore them.

ahhh oh ok great, thanks alot :)
Sep 24 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.