PC Review


Reply
 
 
Alain Dekker
Guest
Posts: n/a
 
      23rd May 2011
How do you tell what version of C# you are using? From online searches it
appears that its not the version of .NET you are targetting but more closely
tied to the IDE.

I am using Visual Studio 2005 at the moment and the Help > About doesn't
tell. From following Google links, it seems VS 2005 uses C# 2 and VS 2008,
uses C# 3, and so on, but it would good if there was some more definitive
way to find out.

Thanks!
Alain


 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      23rd May 2011
On 5/23/2011 6:29 AM, Alain Dekker wrote:
> How do you tell what version of C# you are using? From online searches it
> appears that its not the version of .NET you are targetting but more closely
> tied to the IDE.
>
> I am using Visual Studio 2005 at the moment and the Help> About doesn't
> tell. From following Google links, it seems VS 2005 uses C# 2 and VS 2008,
> uses C# 3, and so on, but it would good if there was some more definitive
> way to find out.


Are you asking about the compiler or the language?

The compiler is tied to the .NET version and the .NET version is tied
to the VS version:

..NET VS CSC
1.0 2002 7.0
1.1 2003 7.1
2.0 2005 8.0
3.5 2008 3.5
4.0 2010 4.0

(apparently MS changed numbering scheme between 2005 and 2008)

The language itself has different version numbers:

MS ECMA-334 standard ISO-23270 standard
1.0 2nd Ed 2003 Ed
2.0 4th Ed 2006 Ed
3.0 -
4.0 -

The correlations between compiler and language are as follows:

..NET VS CSC C# version(s)
1.0 & 1.1 2002 & 2003 7.0 & 7.1 1.0
2.0 2005 8.0 1.0 or 2.0 [2.0 is default]
3.5 2008 3.5 1.0 or 2.0 or 3.0 [3.0 is
default]
4.0 2010 4.0 1.0 or 2.0 or 3.0 or 4.0 [4.0
is default]

Sorry to have made a simple question so complex.

Arne
 
Reply With Quote
 
Alain Dekker
Guest
Posts: n/a
 
      24th May 2011
No, the information is great! Thanks for a detailed answer. Its a nice
feature of the later IDEs to be able to run different versions of C# (if you
didn't want to run the latest). Tat might be useful if you had a legacy
project that wouldn't compile (without significant changes) using the C# 4.0
compiler, but would using the C# 2.0 compiler.

Thanks,
Alain

"Arne Vajhøj" <(E-Mail Removed)> wrote in message
news:4ddade85$0$304$(E-Mail Removed)...
> On 5/23/2011 6:29 AM, Alain Dekker wrote:
>> How do you tell what version of C# you are using? From online searches it
>> appears that its not the version of .NET you are targetting but more
>> closely
>> tied to the IDE.
>>
>> I am using Visual Studio 2005 at the moment and the Help> About doesn't
>> tell. From following Google links, it seems VS 2005 uses C# 2 and VS
>> 2008,
>> uses C# 3, and so on, but it would good if there was some more definitive
>> way to find out.

>
> Are you asking about the compiler or the language?
>
> The compiler is tied to the .NET version and the .NET version is tied
> to the VS version:
>
> .NET VS CSC
> 1.0 2002 7.0
> 1.1 2003 7.1
> 2.0 2005 8.0
> 3.5 2008 3.5
> 4.0 2010 4.0
>
> (apparently MS changed numbering scheme between 2005 and 2008)
>
> The language itself has different version numbers:
>
> MS ECMA-334 standard ISO-23270 standard
> 1.0 2nd Ed 2003 Ed
> 2.0 4th Ed 2006 Ed
> 3.0 -
> 4.0 -
>
> The correlations between compiler and language are as follows:
>
> .NET VS CSC C# version(s)
> 1.0 & 1.1 2002 & 2003 7.0 & 7.1 1.0
> 2.0 2005 8.0 1.0 or 2.0 [2.0 is default]
> 3.5 2008 3.5 1.0 or 2.0 or 3.0 [3.0 is
> default]
> 4.0 2010 4.0 1.0 or 2.0 or 3.0 or 4.0 [4.0
> is default]
>
> Sorry to have made a simple question so complex.
>
> Arne



 
Reply With Quote
 
Alain Dekker
Guest
Posts: n/a
 
      24th May 2011
Thanks, Peter. Its as I suspected. I am presuming that the core of C# syntax
and functionality remains very consistent between the versions. I do note
that Microsoft are adding in optional parameter support into C# (like
default parameters I'm used to from C++), possibly bowing to pressure from
developers. Would I be correct that developers usually upgrade IDEs more for
the .NET feature enhancements rather than the new C# language features?

Thanks again,
Alain

"Peter Duniho" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 5/23/11 3:29 AM, Alain Dekker wrote:
>> How do you tell what version of C# you are using? From online searches it
>> appears that its not the version of .NET you are targetting but more
>> closely
>> tied to the IDE.
>>
>> I am using Visual Studio 2005 at the moment and the Help> About doesn't
>> tell. From following Google links, it seems VS 2005 uses C# 2 and VS
>> 2008,
>> uses C# 3, and so on, but it would good if there was some more definitive
>> way to find out.

>
> You can run the compiler from the command line to see the actual version
> number. But the compiler is precisely tied to the IDE, so barring any
> hacking of the installed tools on your part, you will find that Visual
> Studio versions 2003, 2005, 2008, and 2010 go with C# versions 1, 2, 3,
> and 4, respectively.
>
> Pete



 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      24th May 2011
On 5/24/2011 5:50 AM, Alain Dekker wrote:
> "Arne Vajhøj"<(E-Mail Removed)> wrote in message
> news:4ddade85$0$304$(E-Mail Removed)...
>> On 5/23/2011 6:29 AM, Alain Dekker wrote:
>>> How do you tell what version of C# you are using? From online searches it
>>> appears that its not the version of .NET you are targetting but more
>>> closely
>>> tied to the IDE.
>>>
>>> I am using Visual Studio 2005 at the moment and the Help> About doesn't
>>> tell. From following Google links, it seems VS 2005 uses C# 2 and VS
>>> 2008,
>>> uses C# 3, and so on, but it would good if there was some more definitive
>>> way to find out.

>>
>> Are you asking about the compiler or the language?
>>
>> The compiler is tied to the .NET version and the .NET version is tied
>> to the VS version:
>>
>> .NET VS CSC
>> 1.0 2002 7.0
>> 1.1 2003 7.1
>> 2.0 2005 8.0
>> 3.5 2008 3.5
>> 4.0 2010 4.0
>>
>> (apparently MS changed numbering scheme between 2005 and 2008)
>>
>> The language itself has different version numbers:
>>
>> MS ECMA-334 standard ISO-23270 standard
>> 1.0 2nd Ed 2003 Ed
>> 2.0 4th Ed 2006 Ed
>> 3.0 -
>> 4.0 -
>>
>> The correlations between compiler and language are as follows:
>>
>> .NET VS CSC C# version(s)
>> 1.0& 1.1 2002& 2003 7.0& 7.1 1.0
>> 2.0 2005 8.0 1.0 or 2.0 [2.0 is default]
>> 3.5 2008 3.5 1.0 or 2.0 or 3.0 [3.0 is
>> default]
>> 4.0 2010 4.0 1.0 or 2.0 or 3.0 or 4.0 [4.0
>> is default]
>>
>> Sorry to have made a simple question so complex.

> No, the information is great! Thanks for a detailed answer. Its a nice
> feature of the later IDEs to be able to run different versions of C#

(if you
> didn't want to run the latest). Tat might be useful if you had a legacy
> project that wouldn't compile (without significant changes) using the

C# 4.0
> compiler, but would using the C# 2.0 compiler.


It is not using the old compiler - it is using the new compiler
but telling it to use an old version of the language.

And I would say that it is extremely rare to have the type
of problems you mention.

MS are doing a good job making old code compiler continue
being valid with newer versions of the language.

One of the tricks they apply is that when they add a new
keyword they add it as a contextual keyword. This means that
old code that has used the new keyword as a name actually
still compiles, because the compiler uses the context to determine
whether it is a keyword or a name.

Pretty cool.

The main reason to build with the old language versions is
if you are developing on a new version of VS/.NET, because some projects
require that, but you also need to develop on older projects
using older versions. By specifying the language version you
can ensure that the code will still build in the build environment
(where it will be build with the old versions).

It is also possible to run multiple VS/.NET versions on the
same PC, but many developers quickly become addicted to a new
version of VS.

Arne
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      24th May 2011
On 5/24/2011 10:56 AM, Peter Duniho wrote:
> On 5/24/11 2:53 AM, Alain Dekker wrote:
>> Thanks, Peter. Its as I suspected. I am presuming that the core of C#
>> syntax
>> and functionality remains very consistent between the versions.

>
> C# is 100% backward compatible.


If someone want a list of the difference between those 100% and
real 100%, then MS has publicised lists at:

http://msdn.microsoft.com/en-us/libr...=vs.90%29.aspx
http://msdn.microsoft.com/en-us/library/ee855831.aspx

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 PM.