views:

91

answers:

2

I have a large project where we have 2-3 dll projects that are converted from VB6 to VB.NET. We have fixed all the issues that caused compilation errors, and most of obvious issues in running, so now we have basically a program up and running. The exe is created from scratch in VB.NET, using a lot of functionality from the converted dll's (including GUI forms).

OK, so far so good. What I wonder is when I run the program in debug mode, I get a bunch of warnings in the "Immediate Window" saying:

A first chance exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll

...and some of other type (but most of them in Microsoft.VisualBasic.dll).

I was wondering if this is common in projects converted from VB6, or if it is caused by bad design in our code...

+2  A: 

It's not limited to converted projects. Some info here :

http://blogs.msdn.com/davidklinems/archive/2005/07/12/438061.aspx

http://www.helixoft.com/blog/archives/24

CodeByMoonlight
Great! So First time exception is just that an exception is raised somewhere, and if it does not cause a debug stop somewhere, it just means that the exception was handled properly...
awe
... and the first link tells us how to not display them in the Immediate Window... (just info for those who did not bother to read it...)
awe
I think I would say "first time exception" means the exception was handled somewhere. Whether or not it was handled **properly** is a different question :) Particularly in code that's been around a while and upgraded to a different platform.
MarkJ
+1  A: 

I am not sure of what exactly is causing your exceptions, but if it is in your code and surrounded by catch blocks (that probably do nothing, other than swallow the exception), you can set Visual Studio to break on all errors, which should help you track the problems down.

In VS, go Debug > Exceptions... and you can check what type of exceptions it will break on.

Hope that is of help

Pondidum
+1. In code converted from VB6 you also need to look for `On Error` statements as well as `try-catch`. Find the line in your project (if it is your code) where the exceptions are being thrown, and figure out what is going on. In VB6 there was no alternative but to trigger exceptions/errors for some common tasks, e.g. finding out whether a Collection contained a particular key.
MarkJ