Are C # and .NET versions dependent on each other?

I'm just starting to learn C # and its relationship with .NET. If I want to use the latest language conventions in C #, but would like to target, say, the .NET 2.0 platform, can I do this? Or using the latest C # means I need to use the latest version of .NET?

+4
source share
6 answers

C # as a language is independent of the .net framework.

For example: extension methods is a feature released with C # 3.0 that came with .Net 2.0. Extension methods depend on ExtensionAttribute , which is located in "mscorlib.dll", which was added in .Net 3.5. But you can use extension methods in .Net 2.0, given that you provide your own ExtensionAttributein your library. It should not be in mscorlib. See this question for more information .

As we know, is new in C # 5.0, which was released with .Net 4.5, but we can use async-wait in .NET 4.0 itself .

Sameway, , . .Net framework.

+4

(2013, 2015), 2.0, .NET 2.0 ( ).

0

, # .Net . , # - , .Net.

# , .Net. , #, , .Net . .Net . .Net, .

0

# .Net, , # 2.0 .Net 3.5, , .Net 3.5 # 2.0.

. https://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx

0

# 6.0 .NET 5.0. CLR. # 4, 4.5 4.5.1 4 CLR.

0

All Articles