Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 190 Vote(s) - 3.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Are C# and .NET versions dependent on each other?

#1
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?
Reply

#2
you can use features of lastest visual studio editions (2013, 2015), but the code must be according to 2.0 specifications to allow a .NET 2.0 compilation (older versions)
Reply

#3
Yes, C# and .Net versions are dependent. According to my understanding C# is a programming language which works using .Net Technology.

Learning C# means learning the basic syntax, which is almost the same in all .Net versions. So for learn c#, it doesn't matter which .Net version you must target. Different .Net versions adds up certain new features or functionality. Any way its better to understand latest .Net version which will help you in projects.
Reply

#4
You can use C# features from earlier versions with later versions of .Net, for example, you can use any C# 2.0 feature with .Net 3.5, this does not work the other way arround, so you cannot use .Net 3.5 features with the c# 2.0 compiler.

For more details see: [

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#5
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][1] 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][2].

As we know [tag: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][3].

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.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#6
C# 6.0 is available in .NET 5.0.
It depends on the CLR. C# 4, 4.5 and 4.5.1 are using the CLR Version 4.
Reply

#7
Yes C# is dependent on .net versions. The dependence between the both is on features and technologies provided. Refer following link:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through