본문 바로가기

StackOverflow

[C#] C#의 정확한 버전 정보를 알려주세요

http://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c


Q: C#의 정확한 버전 번호가 어떻게 되나요? "C# 3.5" 에 대한 답변은 찾아볼 수가 없습니다. 

이 질문은 정확하지 않은 C#의 버전 명으로 검색하는 것을 방지하기 위해, 질문자가 정확하게 버전 별 답변을 찾게하기 위해 작성되었습니다.

(질문자: Jon Skeet, community wiki)


A: 현재까지 알려진 버전은 아래와 같습니다

  • C# 1.0 .NET 1.0 과 VS2002 으로 배포 됨. (2002년 1월)
  • C# 1.2 (.NET은 1.1인데 C#은 1.2라서 굉장히 이상하지만) .NET 1.1 그리고 VS2003 (2003년 4월)과 함께 배포됨. 첫 번째 버전은 IDisposable을 구현한 IEnumerator 에서 Dispose를 호출. 이외 몇 가지 변경사항이 있음.
  • C# 2.0 .NET 2.0 과 VS2005 으로 배포 됨. (2005년 11월). 주요 특징: generics, anonymous methods, nullable types, iterator blocks
  • C# 3.0 .NET 3.5 와 VS2008 로 배포 됨.(2007년11월). 주요 특징: lambda expressions, extension methods, expression trees, anonymous types, implicit typing (var), query expressions
  • C# 4.0 .NET 4 와 VS2010 으로 배포 됨.(2010년 4월). 주요 특징: late binding (dynamic), delegate and interface generic variance, more COM support, named arguments and optional parameters
  • C# 5.0 .NET 4.5 와 VS2012로 배포 됨. (2012년 8월). 주요 특징: async programming, caller info attributes. 긴급 변경: loop variable closure.
  • C# 6.0 .NET 4.6과 VS2015 로 배포 됨.(2015 7월). 구현자: Roslyn. 특징: initializers for automatically implemented properties, using directives to import static members, exception filters, binary literals and digit separators, indexed members and element initializers, await in catch and finally, extension Add methods in collection initializers.

C# 3.5는 존재하지 않습니다. C# 3.0이 .NET 3.5와 함께 발표되었기 때문에 이런 착각이 발생한 것입니다. 

이 언어의 프레임웍은 별도의 버전이 부여되었습니다. CLR의 버전은 약간 다른데, CLR 2.0이 .NET 2.0에서 .NET 3.5까지 이용되었고, .NET 4는 CLR 4를 가지고 있으며, 서비스 팩도 동일합니다. .NET 4.5의 CLR 버전은 불분명한데, 아마도 CLR 4.5일 것으로 추정됩니다. MSDN 에서 CLR 4.5로 부르고 있기 때문입니다. 하지만 Environment.Version을 보면 여전히 4.0.xxx 로 버전이 표시됩니다.

C# in Depth 에서 좀 더 상세한 내용을 확인하세요. 언어버전, 런타임 버전, 프레임워크 버전 등의 내용이 있습니다. 예를 들면 .NET 2.0을 타깃으로 개발하는데 C# 3.0을 쓰고 있다면, 어떤 기능을 이용할 수 있는지 확인할 수 있습니다. (누군가 그 내용을 이 위키로 좀 가져와주면, 그 사람들도 좋아할겁니다)

(답변자: Jon Skeet, community wiki)





역주: 

Stackoverflow에서는 "다른 사람의 답변을 수정"할 수도 있으며, 이 때는 원작자가 "승인"을 해주어야 해당 내용이 적용됩니다.

그렇지만, 글을 작성 할 때 Community wiki 로 선언하면 누구나 해당 글을 수정할 수 있게 되며, 마치 wiki처럼 많은 사람들이 자유롭게 의견을 주고 받을 수 있습니다.

참조: http://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts

community wiki를 수정하려면 reputation이 100 이상 있어야 합니다.

그리고, 저 Jon Skeet 이라는 사람은 정말 대단한 사람입니다.

-

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?

This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. "C# 3.5". The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.

shareeditflag


-

1348down voteaccepted

These are the versions of C# known about at the time of this writing:

  • C# 1.0 released with .NET 1.0 and VS2002 (January 2002)
  • C# 1.2 (bizarrely enough); released with .NET 1.1 and VS2003 (April 2003). First version to call Dispose on IEnumerators which implemented IDisposable. A few other small features.
  • C# 2.0 released with .NET 2.0 and VS2005 (November 2005). Major new features: generics, anonymous methods, nullable types, iterator blocks
  • C# 3.0 released with .NET 3.5 and VS2008 (November 2007). Major new features: lambda expressions, extension methods, expression trees, anonymous types, implicit typing (var), query expressions
  • C# 4.0 released with .NET 4 and VS2010 (April 2010). Major new features: late binding (dynamic), delegate and interface generic variance, more COM support, named arguments and optional parameters
  • C# 5.0 released with .NET 4.5 and VS2012 (August 2012). Major features: async programming, caller info attributes. Breaking change: loop variable closure.
  • C# 6.0 released with .NET 4.6 and VS2015 (July 2015). Implemented by Roslyn. Features: initializers for automatically implemented properties, using directives to import static members, exception filters, binary literals and digit separators, indexed members and element initializers, await in catch and finally, extension Add methods in collection initializers.

There is no such thing as C# 3.5 - the cause of confusion here is that the C# 3.0 is present in .NET 3.5. The language and framework are versioned independently, however - as is the CLR, which is at version 2.0 for .NET 2.0 through 3.5, .NET 4 introducing CLR 4.0, service packs notwithstanding. The CLR in .NET 4.5 has various improvements, but the versioning is unclear: in some places it may be referred to as CLR 4.5 (this MSDN page used to refer to it that way, for example), but the Environment.Version property still reports 4.0.xxx.

More detailed information about the relationship between the language, runtime and framework versions is available on the C# in Depth site. This includes information about which features of C# 3.0 you can use when targeting .NET 2.0. (If anyone wants to bring all of the content into this wiki answer, they're welcome to.)

shareeditflag