.NET is a general-purpose software development platform, similar to Java. At its core is a virtual machine (called as CLR) that turns intermediate language (IL) into machine code. High-level language compilers for C#, VB.NET and C++ are provided to turn source code into IL. C# is a new programming language, very similar to Java. An extensive class library is included, featuring all the functionality one might expect from a contempory development platform - windows GUI development (Windows Forms), database access (ADO.NET), web development (ASP.NET), web services, XML etc.
Currently, it is supported on Windows 98, Windows 2000/2003, Windows XP and Windows Vista. ASP.NET integrates with Internet Information Server (IIS) and thus requires that IIS be installed.
.NET Compcat Framework runs on Windows CE or Windows Mobile. Mono is an open source project to provide .Net on Linux.The CLI (Common Language Infrastructure) is the definiton of the fundamentals of the .NET framework - the Common Type System (CTS), metadata, the Virtual Execution Environment (VES) and its use of intermediate language (IL), and the support of multiple programming languages via the Common Language Specification (CLS).
The CLR (Common Language Runtime) is Microsoft's primary implementation of the CLI. Other implementations are; the .NET Compact Framework for mobile devices, non-Microsoft CLI implementations like Mono and DotGNU Portable.NET.
IL = Intermediate Language. Also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language). All .NET source code (of any language) is compiled to IL during development. The IL is then converted to machine code at run-time by a Just-In-Time (JIT) compiler. Just like how Java programs are converted to Bytecode, C# and VB.NET code is converted to IL.
Microsoft first announced .NET in June,2000. The following were the offical releases of .NET.
The following table shows ASP.NET and C# versions along with .NET versions.
.NET | ASP.NET | C# |
---|---|---|
1.0 | 1.0 | 1.0 |
1.1 | 1.1 | 1.1 |
2.0 | 2.0 | 2.0 |
3.0 | ||
3.5 | 3.5 | 3.0 |
LINQ (Language Integrated Query) is a new way to access database, xml documents and collections. It enables programmers to access all data sources with expressions in C# and VB.NET. For example, we can access database without using any SQL using C# or VB.NET expressions.
C# is a new language designed by Microsoft to work with the .NET framework. In their "Introduction to C#" whitepaper, Microsoft describe C# as follows: "C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced “C sharp”) is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++."
C# (or VB.NET) can be used to develop all types of applications - Console, Windows, Web, Web Services and Mobile.The .NET framework provides several core run-time services to the programs that run within it - for example exception handling, memory management and security. For these services to work, the code must provide a minimum level of information to the runtime. Such code is called managed code.
Managed data: This is data that is allocated and freed by the .NET runtime's garbage collector.
Assemblies are classified as private assemblies and global assemblies.
Private assemblies are simple and copied to bin directory of the application that is using it.
Shared assemblies (also called as gobal assemblies) are copied to a single location called GAC (Global assembly cache). Hence, shared assemblies are not copied in the private folders of each calling application.Each shared assembly has a four part name including its name, version, public key token and culture information. The public key token and version information makes it almost impossible for two different assemblies with the same name or for two similar assemblies with different version to mix with each other.
A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality.
The concept of a namespace is not related to that of an assembly. A single assembly may contain types whose hierarchical names have different namespace roots, and a logical namespace root may span multiple assemblies.
In the .NET Framework, a namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.
using System; using System.Runtime.InteropServices; class MainApp { [DllImport("user32.dll", EntryPoint="MessageBox")] public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType); public static void Main() { MessageBox(0, "This is PInvoke in operation!", ".NET", 0 ); } }