Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm just starting to learn C# and its relationship to .NET. If say I wanted to take advantage of the latest C# language conventions, but wanted to target, say a .NET 2.0 framework, could I do that? Or does using the latest C# mean I have to use the latest .NET?

like image 270
tralston Avatar asked Feb 23 '15 08:02

tralston


People also ask

Is C+ the same as C?

The main difference between C and C++ is that C++ is a younger, more abstract language. C and C++ are both general-purpose languages with a solid community. C is a lightweight procedural language without a lot of abstraction. C++ is an object-oriented language that provides more abstraction and higher-level features.

What is meant by C?

noun plural c's, C's or Cs. the third letter and second consonant of the modern English alphabet. a speech sound represented by this letter, in English usually either a voiceless alveolar fricative, as in cigar, or a voiceless velar stop, as in case.

What is C language used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What are identifiers in C?

"Identifiers" or "symbols" are the names you supply for variables, types, functions, and labels in your program. Identifier names must differ in spelling and case from any keywords. You cannot use keywords (either C or Microsoft) as identifiers; they are reserved for special use.


1 Answers

C# as a language is not dependent on .net framework.

For example: Extension methods is a feature released with C# 3.0 which came along with .Net 2.0. Extension methods depends on ExtensionAttribute which lives 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 ExtensionAttribute in your library itself. It doesn't needs to be in mscorlib. Refer this question for more info.

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

Sameway, most of the dependencies of language features can be defined in your own assembly to make it work. So it doesn't need the particular .Net framework version.

like image 184
Sriram Sakthivel Avatar answered Oct 18 '22 08:10

Sriram Sakthivel