473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ 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 4781
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
5336
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 idea to me. I have a namespace Company.Web. I have created a PageBase.vb file with a PageBase class containing the the properties required. This...
7
6675
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 sporadically without message. It's not possible to debug in visual studio, i get no exceptions (application is terminated unexpectedly without...
2
24509
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 this point a lot of it is working just fine, my app running fine, threads r being made and destroyed, memory is being dynamically allocated at God...
0
3653
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 delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released?...
2
2065
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 These lines do not cause the application to stop functioning. I have also noticed a few system.data first chance exceptions. How do I determine which...
15
11054
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 anything reported on the event viewer. Giving the user full access to C:\ drive also doesn't do the trick. Unfortunately, we do not have the code of this...
8
2434
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 call a method of my service if have 2 first time exceptions
0
1192
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 that it will stop on such exceptions but can not find it. Can you tell me how to set that?
4
1367
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. -- Dennis in Houston
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
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 we have to send another system

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.