473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[VB.net] - Dealing with First Chance Exceptions

79 New Member
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
6 4756
balabaster
797 Recognized Expert Contributor
Check out this article about first chance exceptions, it may be useful:

http://social.msdn.microsoft.com/For...-f3c840d72b55/
Sep 21 '08 #2
zubair1
79 New Member
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
797 Recognized Expert Contributor
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
zubair1
79 New Member
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
797 Recognized Expert Contributor
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
zubair1
79 New Member
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

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

Similar topics

15
by: Ben Mann | last post by:
Hi there, I am starting on an ASP .Net project. I have some examples of using a base class for pages to inherit from to allow additional properties to be used by default. This seems like a good...
7
by: Ralf Gedrat | last post by:
Hello! I have some Vb.Net applications, which are terminated at indefinite times without message. If I call in the program regulated system.GC.Collect, then the program is terminated here...
2
by: Abubakar | last post by:
Hi all, I'm writing an app in vc++ 2k5 (all native/unmanaged). This application does a lot of multithreading and socket programming. Its been months since I'm developing this application, at...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
2
by: | last post by:
VStudio 2005 Pro. In the Immediate window for a running application I continually see lines like A first chance exception of type'System.Runtime.InteropServices.COMException' occured in ...
15
by: eltonchew | last post by:
Hi, We have an inhouse developed VB.NET Windows application which runs successfully only when the user is given a local administrator rights. Without which, it fails to start. There isn't...
8
by: Olivier BESSON | last post by:
Hello, VB.NET 1.1 IIS 6 I'm developping a winform client app of a web service of mine. I used to set the IDE with "halt in debugger" on "common language runtime exceptions". Every time i...
0
by: Academia | last post by:
I see the following in my "Output" pane when I run my program. A first chance exception of type 'System.NullReferenceException' occurred in .... I believe there is a way to configure VS so...
4
by: =?Utf-8?B?RGVubmlz?= | last post by:
Is there any way to find out what is causing a "First Chance Exception"? Also, is there anyway to turn them off....I'm getting hundreds but all seems to run OK. I"m using VB 2008 Express Edition....
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.