Can C# 2003 upgrade to C# 2005?

B

Brett

I have a C# project created in VS.NET 2003. I tried to run it in VS.NET
2005. 2005 did a conversion. I see much VB code and VB style comments. I
don't know what it did. Will a 2003 C# project run in 2005?

Thanks,
Brett
 
B

Bonj

You shouldn't need to "convert" a C# 2003 project to compile with C# 2005 -
as far as I know they're backwards compatible.
You must have converted it to a VB project if you have ended up with VB
code.
There's several possibilities - one is that in 2003 you didn't have VB
installed but with 2005 you did, and you thought the top option was C# when
in fact when you've got VB installed its projects appear above C#'s, and you
clicked VB by mistake.
The other is you've been sucked in by an underhand attempt by Microsoft to
force you into "VB2005" (the version of VB.NET upgraded to not have the
".NET" title) - if that's the case you're probably doomed for life and will
likely also have to sign over your soul to it.
A third is that the C# project was actually a solution that had a VB project
as one of its dependencies and it is this you are looking at.
The fourth is that the VB code is not actually a project but an IDE-macro,
which as far as I know can only be written in VB.

Try it to see if it will compile. If it does it will probably all be ok.
However I'm sure C# 2005 isn't different in syntax to C# 2003...
 
D

Daniel O'Connell [C# MVP]

Bonj said:
You shouldn't need to "convert" a C# 2003 project to compile with C#
2005 - as far as I know they're backwards compatible.

The project file format has changed, so there is a conversion process that
occurs when loading a 2003 project or solution. But that will not change any
of your code.
 
S

Søren Reinke

Daniel O'Connell said:
The project file format has changed, so there is a conversion process that
occurs when loading a 2003 project or solution. But that will not change
any of your code.

Does that mean you are forever stuck with VS2005 ?

Or can you still develop using VS2003 ?
 
D

Daniel O'Connell [C# MVP]

Soren Reinke said:
Does that mean you are forever stuck with VS2005 ?

Or can you still develop using VS2003 ?

Well, VS will bakcup the solution file, but that file is vs2005+ only as the
format is entirely different(It uses the MSBuild xml format now), so you'll
have to use some kinda tool to swap back and forth if you need to use both.
 
C

Chuck Heatherly

Well, VS will bakcup the solution file, but that file is vs2005+ only as the
format is entirely different(It uses the MSBuild xml format now), so you'll
have to use some kinda tool to swap back and forth if you need to use both.

I am doing this now with VS2005 Beta 2. I have it and VS 2003 installed
together, and I have subdirectories named "2003" and "2005" in my project
directory where I keep the different versions of the .csproj and .sln files,
keeping the program source files in the main project directory.

But if you are doing something like this, be sure to delete the /obj
subdirectory before running VS2003 after having run VS2005, because VS2003
(understandably) croaks when trying to work with binary outputs created by
VS2005.

Chuck
 
S

Søren Reinke

Chuck Heatherly said:
I am doing this now with VS2005 Beta 2. I have it and VS 2003 installed
together, and I have subdirectories named "2003" and "2005" in my project
directory where I keep the different versions of the .csproj and .sln
files,
keeping the program source files in the main project directory.

But if you are doing something like this, be sure to delete the /obj
subdirectory before running VS2003 after having run VS2005, because VS2003
(understandably) croaks when trying to work with binary outputs created by
VS2005.

Hi Chuck

Thanks for the tips, that is just the situation i might end up in, having to
use both versions for now.
 

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