Reputation: 1223
I know its extensive topic but I have failed to find some basic overview. I would like to know what is exactly the relation between these two. I know I need .NET SP2 to work with VS 2010, so client PC will need to have the same version of .NET I guess. I would be very grateful if someone could tell me in a few sentences what is .NET and how it relates ti C#
Upvotes: 4
Views: 6067
Reputation: 59163
.NET is a framework. What that means is that the .NET platform contains libraries of existing code and architecture from which all applications utilizing it build from. So rather than pouring a new foundation for every house, you already start off with a solid one that has been perfected and improved upon over time. In addition to a starting foundation, the framework serves as a sort of toolbox of existing code that saves you from reinventing the wheel every time you need certain things.
For instance, winforms is an established foundation from which to build windows applications with a rudimentary user interface simply by going to file > new project. You would have to interface with GDI yourself to generate windows forms and user interface if this library of existing code was not there to support you.
C# is simply a programming language. One specifically written with .NET in mind. In fact, most of the .NET framework is written in C# (if not all of it). It's syntax is simply the next progression of the C language, thus transitioning from C++ to C# shouldn't be too difficult. It's a paradigm shift with a lot of things, but at least the syntax is often familiar. Any .NET language is usually compatible with other .NET languages. For instance, I could write a class library in Visual Basic, and you could use that compiled library in your C# program.
Because .NET is a framework, the code you reference in it does not get compiled into your program, rather a reference to code in the framework is all that gets compiled. This means that clients running your program must also have the .NET framework, albeit a stripped down version. They don't need all the development tools that you need so their .NET framework download is a little smaller. Clients running Windows Vista/7 don't need to worry about anything; it's included with their OS. Only certain users running XP would even have to worry about downloading the framework, and most programs accurately detect the requirement and inform the end user to go download it.
All versions of Visual Studio are simply tools to help you build applications and better utilize the .NET framework. I would never recommend coding in any .NET language without at least the express (free) edition of visual studio. Intellisense alone is worth it. That said, it is definitely possible to code something in .NET without the Visual Studio IDE. You could open up notepad right now and write a C# program, compile it with the free compiler, and run it. While Visual Studio 2010 is pretty amazing, and uses the new WPF platform to run, 2008 will serve you just as well. 2010 is optimized for .NET 4 but works just fine when targeting previous versions of .NET as well.
Bottom line:
That is how they are all related.
Upvotes: 12
Reputation: 1173
As Chevex says .NET is a framework and C# is just one of several languages targeting the framework.
Not sure about what you mean about "SP2" and VS2010. The language features you use will determine what version of the framework is required on the clients running your code.
See here for more information:
http://msdn.microsoft.com/en-us/library/bb822049.aspx
http://msdn.microsoft.com/en-us/library/8z6watww.aspx
Upvotes: 0
Reputation: 297
C# is a programming language, very similiar to c++. .NET is a set of libraries, classes, ready to use methods etc. It is strictly related to C#. You use them both without noticing it :)
Every 'using' statement imports a set of classes to your project from .NET.
Upvotes: 0
Reputation: 66531
(This is probably a duplicate, but the best answer is off-site)
Quoting from Jon Skeet:
There are lots of different versions of different elements of development. You need to distinguish between the versions of Visual Studio (the IDE), C# (the language) and .NET (the framework). It's quite hard to talk about each of these individually without bringing in other pieces, but I'll see what I can do... Note that I'll avoid introducing the CLR versions as well, as most developers don't really need to know about that.
There have been five significant releases of the .NET Framework, excluding service packs. The framework includes the compilers, runtime, and libraries.
There are three significant language versions:
Read the rest here: http://csharpindepth.com/Articles/Chapter1/Versions.aspx
Upvotes: 2
Reputation: 292345
Basically:
Upvotes: 0