Conversion from VB 6 to VB.NET 2005

V

Vince

Hi all,

I am trying to convert a VB 6 application to VB.NET 2005 using the wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence
variables are properly declared and used. I also made sure that there was no
design time (ItemData) listings in the list. However, when I try to convert
to .NET, two things happen:

a) It gives me over 5500 errors!! (Many of them include 'could not resolve
type' inspite of explicit declarations)
b) It quits halfway with a message like "An exception has occurred". The
usual Report to MS crops up and at the end of it, I am left with over 5500
baffling errors and a failed attempt at conversion.

My questions are:

a) Is there anything I can do in the existing VB 6 program to ease the
conversion process?
b) Any sites on the web that provide a lot of information on this?
c) Does anybody know why the thing quit halfway through the conversion?
d) This is a live project that I developed an year back and is likely to be
used for a long time to come. Is it necessary that I take the pains to learn
and shift the application to .NET?

If I need to send the report (over 2 MB!!!) please let me know.

Would appreciate any insight into this.

Vince
 
H

Herfried K. Wagner [MVP]

Vince said:
I am trying to convert a VB 6 application to VB.NET
2005 using the wizard.

Notice that this is still Beta software!
a) Is there anything I can do in the existing VB 6 program to
ease the conversion process?

Micrososoft Visual Basic Code Advisor
b) Any sites on the web that provide a lot of information on this?

d) This is a live project that I developed an year back and
is likely to be used for a long time to come. Is it necessary
that I take the pains to learn and shift the application to .NET?

If the project is split up into multiple components, you can start
converting some of the DLLs, make them usable from COM and use then instead
of the ActiveX DLLs.
 
V

Vince

Thanks for the links & info Cor & Herfried.
I wanted to migrate to VB.NET but since its new brother (2005) is in town,
it's hard for me to think 2003, although 2005 is still a beta.
Vince
 
C

Chris Dunaway

I am trying to convert a VB 6 application to VB.NET 2005 using the wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence

Since your VB6 project is more than 20 forms, I presume that it is a large
application. Even if the conversion wizard completed without any errors,
it is likely that the result would be less than optimal.

Is it absolutely necessary that the app be converted to .Net? If not, I
would recommend keeping the app in VB6 and then begin to convert or
redesign the next version of the app to fit the VB.Net design paradigm.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
N

Nak

Hi Vince,
it's hard for me to think 2003, although 2005 is still a beta.
Vince

It's a risky and extremely frustrating process developing software with
a beta IDE, rather you than me!

Nick.
 
S

Steve Long

I just completed converting a project to .NET 2003 that was a large project
and let me tell you, it is no trivial undertaking. If I had it to do over
again, I would leave it and try to design a new project along the lines of
"little at a time" variety.

The problem with writing your new DLL's in .net and making them COM
compatible, is that it is difficult to debug between the two platforms (vb6
and .NET). .NET doesn't do this very well were the projects are very large.
This methodology is okay for smaller DLL's were you can test them fully in a
..NET test harness before moving them over to VB6 but is totally cumbersome
for larger DLL's.
Designing .NET test harnesses for your larger DLL's can be time consuming
which begs the question: do I really need to do this. If not, leave it and
let that VB6 code hang around as long as it is useful.
Along with porting this app to .NET, I also ported the ActiveX DLL's so at
least now, I've got a bunch of .NET asymblies that are useful. However,
there was more than one time that I thought the whole project would fail.

As for all those error messages that you get from the compiler, I just had
to walk my way through them fixing them one at a time. There were some that
didn't even really need fixing but the converter thought there was a
problem. Nothing like doing a little desk checking I suppose huh?

Steve

Chris Dunaway said:
I am trying to convert a VB 6 application to VB.NET 2005 using the wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence

Since your VB6 project is more than 20 forms, I presume that it is a large
application. Even if the conversion wizard completed without any errors,
it is likely that the result would be less than optimal.

Is it absolutely necessary that the app be converted to .Net? If not, I
would recommend keeping the app in VB6 and then begin to convert or
redesign the next version of the app to fit the VB.Net design paradigm.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
J

Jay B. Harlow [MVP - Outlook]

Steve,
Designing .NET test harnesses for your larger DLL's can be time consuming
which begs the question: do I really need to do this.

Absolutely!!! Especially when you write the tests first, then the code.
Which is the methodology behind TDD (Test Driven Development). NOTE: With
TDD you do not write a "test harness" per se, you use an existing "test
harness" such as NUnit or csUnit, you do however write a suite of tests
(simply methods with asserts in them) that test your classes & all the
methods.

I'm using NUnit 2.2 http://www.nunit.org/ and like it better then earlier
versions (of NUnit). VS.NET 2005 Team System will have a TDD tool built-in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsent/html/vsts-test.asp.

I've been using TDD more and more over the last year or so. I find Daniel
Cazzulino's comment to be my findings also:
http://weblogs.asp.net/cazzu/archive/2004/10/07/239449.aspx

I recently starting reading James W. Newkirk & Alexei A. Vorontsov's book
"Test-Driven Development in Microsoft .NET" which explains TDD in the
context of .NET, I would highly recommend this book!

Of course if you don't have the tests to begin with, then you may have your
work cut out for you...

NOTE: I would not migrate a VB6 project to .NET simply to be on .NET, I
would migrate the project so that I can leverage the full OO that .NET has
to offer. I have a couple of substantial (100s of classes) projects that I
have migrated. I find using Refactoring (http://www.refactoring.com) on the
migrated project to be an "easier" method of redesigning the app, rather
then design a brand new project in VB.NET...

Hope this helps
Jay

Steve Long said:
I just completed converting a project to .NET 2003 that was a large project
and let me tell you, it is no trivial undertaking. If I had it to do over
again, I would leave it and try to design a new project along the lines of
"little at a time" variety.

The problem with writing your new DLL's in .net and making them COM
compatible, is that it is difficult to debug between the two platforms
(vb6
and .NET). .NET doesn't do this very well were the projects are very
large.
This methodology is okay for smaller DLL's were you can test them fully in
a
.NET test harness before moving them over to VB6 but is totally cumbersome
for larger DLL's.
Designing .NET test harnesses for your larger DLL's can be time consuming
which begs the question: do I really need to do this. If not, leave it and
let that VB6 code hang around as long as it is useful.
Along with porting this app to .NET, I also ported the ActiveX DLL's so at
least now, I've got a bunch of .NET asymblies that are useful. However,
there was more than one time that I thought the whole project would fail.

As for all those error messages that you get from the compiler, I just had
to walk my way through them fixing them one at a time. There were some
that
didn't even really need fixing but the converter thought there was a
problem. Nothing like doing a little desk checking I suppose huh?

Steve

Chris Dunaway said:
I am trying to convert a VB 6 application to VB.NET 2005 using the wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence

Since your VB6 project is more than 20 forms, I presume that it is a
large
application. Even if the conversion wizard completed without any errors,
it is likely that the result would be less than optimal.

Is it absolutely necessary that the app be converted to .Net? If not, I
would recommend keeping the app in VB6 and then begin to convert or
redesign the next version of the app to fit the VB.Net design paradigm.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
S

Steve Long

Good info Jay. Thanks.
Steve

Jay B. Harlow said:
Steve,
Designing .NET test harnesses for your larger DLL's can be time consuming
which begs the question: do I really need to do this.

Absolutely!!! Especially when you write the tests first, then the code.
Which is the methodology behind TDD (Test Driven Development). NOTE: With
TDD you do not write a "test harness" per se, you use an existing "test
harness" such as NUnit or csUnit, you do however write a suite of tests
(simply methods with asserts in them) that test your classes & all the
methods.

I'm using NUnit 2.2 http://www.nunit.org/ and like it better then earlier
versions (of NUnit). VS.NET 2005 Team System will have a TDD tool built-in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsent/html/vsts-test.asp.

I've been using TDD more and more over the last year or so. I find Daniel
Cazzulino's comment to be my findings also:
http://weblogs.asp.net/cazzu/archive/2004/10/07/239449.aspx

I recently starting reading James W. Newkirk & Alexei A. Vorontsov's book
"Test-Driven Development in Microsoft .NET" which explains TDD in the
context of .NET, I would highly recommend this book!

Of course if you don't have the tests to begin with, then you may have your
work cut out for you...

NOTE: I would not migrate a VB6 project to .NET simply to be on .NET, I
would migrate the project so that I can leverage the full OO that .NET has
to offer. I have a couple of substantial (100s of classes) projects that I
have migrated. I find using Refactoring (http://www.refactoring.com) on the
migrated project to be an "easier" method of redesigning the app, rather
then design a brand new project in VB.NET...

Hope this helps
Jay

Steve Long said:
I just completed converting a project to .NET 2003 that was a large project
and let me tell you, it is no trivial undertaking. If I had it to do over
again, I would leave it and try to design a new project along the lines of
"little at a time" variety.

The problem with writing your new DLL's in .net and making them COM
compatible, is that it is difficult to debug between the two platforms
(vb6
and .NET). .NET doesn't do this very well were the projects are very
large.
This methodology is okay for smaller DLL's were you can test them fully in
a
.NET test harness before moving them over to VB6 but is totally cumbersome
for larger DLL's.
Designing .NET test harnesses for your larger DLL's can be time consuming
which begs the question: do I really need to do this. If not, leave it and
let that VB6 code hang around as long as it is useful.
Along with porting this app to .NET, I also ported the ActiveX DLL's so at
least now, I've got a bunch of .NET asymblies that are useful. However,
there was more than one time that I thought the whole project would fail.

As for all those error messages that you get from the compiler, I just had
to walk my way through them fixing them one at a time. There were some
that
didn't even really need fixing but the converter thought there was a
problem. Nothing like doing a little desk checking I suppose huh?

Steve

Chris Dunaway said:
On Mon, 11 Oct 2004 14:13:05 +0800, Vince wrote:

I am trying to convert a VB 6 application to VB.NET 2005 using the wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence

Since your VB6 project is more than 20 forms, I presume that it is a
large
application. Even if the conversion wizard completed without any errors,
it is likely that the result would be less than optimal.

Is it absolutely necessary that the app be converted to .Net? If not, I
would recommend keeping the app in VB6 and then begin to convert or
redesign the next version of the app to fit the VB.Net design paradigm.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
V

Vince

Thanks a lot everybody for the info. I'll invest some 4 days more in testing
and reading through the links. If it turns out to be Mission Impossible,
I'll develop the next version in .NET.
Vince
Steve Long said:
Good info Jay. Thanks.
Steve

Jay B. Harlow said:
Steve,

Absolutely!!! Especially when you write the tests first, then the code.
Which is the methodology behind TDD (Test Driven Development). NOTE: With
TDD you do not write a "test harness" per se, you use an existing "test
harness" such as NUnit or csUnit, you do however write a suite of tests
(simply methods with asserts in them) that test your classes & all the
methods.

I'm using NUnit 2.2 http://www.nunit.org/ and like it better then earlier
versions (of NUnit). VS.NET 2005 Team System will have a TDD tool built-in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsent/html/vsts-test.asp.
I've been using TDD more and more over the last year or so. I find Daniel
Cazzulino's comment to be my findings also:
http://weblogs.asp.net/cazzu/archive/2004/10/07/239449.aspx

I recently starting reading James W. Newkirk & Alexei A. Vorontsov's book
"Test-Driven Development in Microsoft .NET" which explains TDD in the
context of .NET, I would highly recommend this book!

Of course if you don't have the tests to begin with, then you may have your
work cut out for you...

NOTE: I would not migrate a VB6 project to .NET simply to be on .NET, I
would migrate the project so that I can leverage the full OO that .NET has
to offer. I have a couple of substantial (100s of classes) projects that I
have migrated. I find using Refactoring (http://www.refactoring.com) on the
migrated project to be an "easier" method of redesigning the app, rather
then design a brand new project in VB.NET...

Hope this helps
Jay
lines
fully
so
at
least now, I've got a bunch of .NET asymblies that are useful. However,
there was more than one time that I thought the whole project would fail.

As for all those error messages that you get from the compiler, I just had
to walk my way through them fixing them one at a time. There were some
that
didn't even really need fixing but the converter thought there was a
problem. Nothing like doing a little desk checking I suppose huh?

Steve

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message On Mon, 11 Oct 2004 14:13:05 +0800, Vince wrote:

I am trying to convert a VB 6 application to VB.NET 2005 using the
wizard.
It has over 20 forms and I've used Option Explicit everywhere, hence

Since your VB6 project is more than 20 forms, I presume that it is a
large
application. Even if the conversion wizard completed without any errors,
it is likely that the result would be less than optimal.

Is it absolutely necessary that the app be converted to .Net? If
not,
I
would recommend keeping the app in VB6 and then begin to convert or
redesign the next version of the app to fit the VB.Net design paradigm.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top