Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Howard Kai » Tue, 04 Nov 2003 16:17:40


Is there any (reasonable) way to use a single set of source files for both
VB .NET 2002 and VB .NET 2003.

I'd sure like to do coding changes in only one place, but I seem to need a
separate directory for each VB .NET version.

--
http://www.yqcomputer.com/ ; See Howard Kaikow's web site.
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Jay B. Har » Tue, 04 Nov 2003 16:24:51

Howard,
There is a utility at Code Project that will convert a VS.NET 2003 solution
back to VS.NET 2002.

http://www.yqcomputer.com/

As long as you stay away from VB.NET 2003 constructs (For Each item As
Integer & bit shift operators) there should be no real problems converting
the project back to VS.NET 2002 when working on it on campus.

The one quirk you will find is that VB.NET 2003 removes the parenthesis on
the constructor when creating new objects with the default constructor,
while VB.NET 2002 wants them there.

' VS.NET 2003 syntax
Dim x as New MainForm

' VS.NET 2002 syntax
Dim x as New MainForm()

Hope this helps
Jay

 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Howard Kai » Tue, 04 Nov 2003 16:47:21

Ah, yes, now I recall, I downloaded that on 7 September.

--
http://www.yqcomputer.com/ ; See Howard Kaikow's web site.


solution


both
a
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Fergus Coo » Tue, 04 Nov 2003 17:29:56

Hi Jay,

Unless it's my VS2002, in which case it doesn't seem to mind Dim x As New
MainForm sans brackets.
??

Does this converter correctly handle resx files, eg for PictureBoxes that
are loaded with images in InitializeComponent? My VS always falls over when I
load an OP's VS2003 Forms with graphics.

Regards,
Fergus
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by hirf-spam- » Tue, 04 Nov 2003 21:20:19

* "Howard Kaikow" < XXXX@XXXXX.COM > scripsit:

Add the file to the 2nd project (if there are no resX ressources) by
opening the "Add Existing File..." dialog and choosing "Reference" from
the dropdown of the "Add" button. Notice that you must not use VB.NET
2003 syntax in the file in order to use it within the VS.NET 2002
project.

--
Herfried K. Wagner
MVP VB Classic, VB.NET << http://www.yqcomputer.com/ ;>
<< http://www.yqcomputer.com/ ;>
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Jay B. Har » Wed, 05 Nov 2003 00:11:04

Fergus,
on
New
I did not mean to imply any sort of bug by that statement more an
observation of behavior, the auto correct intellisense in 2002 will put the
parenthesis there, while 2003 will remove them. You will wind up with
inconsistent code, albeit it will still compile. Just be mindful when you
modify the line as you may get an array of elements when you meant to have a
single element.

that
when I
I rarely use the converter, the page implies that it does. Are you using the
converter & is it failing? Or are you attempt a manual conversion and it is
failing? If you go to the page for the utility it states what all is
changed, it changes something in the base64 encoding of objects, which may
be what you are seeing.

Hope this helps
Jay



New
that
when I
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Fergus Coo » Wed, 05 Nov 2003 01:37:30

Hi Jay,

If AutoCorrect is the same as Prettify (Messify) then I don't use it. And
while I like Foo() in C#, I hate it in VB because of the ambiguity and for
being optional which leads to inconsistency - so no () for me! :-).

I've been (failing when) converting by hand because of this Base64 thing.
I've downloaded the converter since asking (thanks for the link) and will try
it out when the next 2003 project comes in. Manual definitely isn't any good
so it is very possibly going to help.

Cheers,
Fergus
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Jay B. Har » Wed, 05 Nov 2003 03:05:41

Fergus,
Yes its the same option as Prettify & Messify, the code reformatter.

Hope this helps
Jay



And
thing.
try
good
 
 
 

Using one set of souce files for both VB .NET 2002 and VB .NET 2003

Post by Howard Kai » Wed, 05 Nov 2003 05:44:16

That's what I was planning on doing.
I'm in the midst of shifting to using VB .NET 2003, so I've got lots of
projects to convert.
Fortunately, most of the projects are upgrades from VB 6, so I can always
use the VB 6 code to recreate the VB.NET 2002 critter.
The troublesome ones are those that I created anew in VB .NET.
--
http://www.yqcomputer.com/ ; See Howard Kaikow's web site.


both
a