.NET Framework
From Free net encyclopedia
The Microsoft .NET Framework, more commonly known as simply the .NET Framework, is a component of the Microsoft Windows operating system. It provides a large body of pre-coded solutions to common program requirements, and manages the execution of programs written specifically for the framework. The .NET Framework is a key Microsoft offering, and is intended to be used by most new applications created for the Windows platform.
The pre-coded solutions form the framework's class library and cover a large range of programming needs in areas including the user interface, data access, cryptography, numeric algorithms, and network communications. The functions of the class library are used by programmers who combine them with their own code to produce applications.
Programs written for the .NET framework execute in a software environment that manages the program's runtime requirements. This runtime environment, which is also a part of the .NET framework, is known as the Common Language Runtime (CLR). The CLR provides the appearance of an application virtual machine, so that programmers need not consider the capabilities of the specific CPU that will execute the program. The CLR also provides other important services such as security guarantees, memory management, and exception handling.
The class library and the CLR together comprise the .NET framework. The framework is intended to make it easier to develop computer applications and to reduce the vulnerability of applications and computers to security threats. First released in 2002, it is included with current versions of Windows, and can be installed on most older versions. The 2.0 version of the framework, released in November 2005, remains the current version as of April 2006.
Contents |
Description
The .NET Framework was designed with several intentions :
- Interoperability - Because so many COM libraries have already been created, the .NET Framework provides methods for allowing interoperability between new code and existing libraries.
- Common Runtime Engine - Programming languages on the .NET Framework compile into an intermediate language known as the Common Intermediate Language, or CIL; Microsoft's implementation of CIL is known as Microsoft Intermediate Language, or MSIL. In Microsoft's implementation, this intermediate language is not interpreted, but rather compiled in a manner known as just-in-time compilation (JIT) into native code. The combination of these concepts is called the Common Language Infrastructure (CLI), a specification; Microsoft's implementation of the CLI is known as the Common Language Runtime (CLR).
- Language Independence - The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible datatypes and programming constructs supported by the CLR and how they may or may not interact with each other. Because of this feature, the .NET Framework supports development in multiple programming languages. This is discussed in more detail in the .NET languages section below.
- Base Class Library - The Base Class Library (BCL), sometimes referred to as the Framework Class Library (FCL), is a library of types available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions such as file reading and writing, graphic rendering, database interaction, XML document manipulation, and so forth.
- Simplified Deployment - Installation and deployment of Windows applications has been the bane of many developers' existence. Registry settings, file distribution and DLL hell have been nearly completely eliminated by new deployment mechanisms in the .NET Framework.
- Security - .NET allows for code to be run with different trust levels without the use of a separate sandbox.
The design of the .NET framework is such that it supports platform independence. That is, a program written to use the framework should run without change on any platform for which the framework is implemented. At present, Microsoft has implemented the full framework only on the Windows operating system. Microsoft and others have implemented portions of the framework on non-Windows platforms, but to date those implementations are not widely used.
History
.NET is the combination of many technologies, including those of the web server department for ASP 4.0, those of the Microsoft distributed computing departments for "Next-Generation Window Services", and those for what may otherwise have become COM+ 2.5.
When Microsoft decided to end their future use of Sun's Java technologies in 1998 due to a lawsuit involving Java extensions, the existing Microsoft J++ (Java) product was transformed into the beginnings of the .NET project. Code from the .NET Common Language Runtime (CLR) was said to have come from Colusa Software's OmniVM, which Microsoft acquired on March 12, 1996.
The CLR is the Microsoft implementation of the ECMA CLI standard for the Windows platform only. The Mono framework provides a partial implementation of the CLI and some parts of the .NET framework for Linux, Solaris, Windows, and Unix.
While the original model of .NET was that of a general foundation (.NET framework) with three primary pillars (ASP.NET, Windows, and Web Services), the model for .NET 2.0 is that of a foundation for Microsoft's next generation platform known as WinFX, which is the unification of Microsoft development technologies into one programming model. WinFX is also the replacement for the longlived Win32 API introduced in the early 1990s. The FX in WinFX (often pronounced as Win effects) is the abbreviation for the .NET Framework thus ensuring that the majority of future Microsoft-based development will have a .NET foundation.
A fourth component of the .NET Framework is the Compact Framework that is designed to run on Windows CE devices such as the Pocket PC, the Smartphone and other generalized Windows CE (or WinCE) packages. The Compact Framework runs as component of the Windows CE operating System, which is a shared source O/S, and can be modified easily. The Compact Framework is smaller than the .NET Framework and fits nicely onto the WinCE footprints. The Compact Framework allows much of the code designed for the larger versions of Windows to work on the compact devices.
Versions
Microsoft has released many different versions of .NET. [1]
.NET Framework 1.0
Full version number - 1.0.3705
This is the initial .NET Framework, released in January 2002. It is available on its own as a redistributable package or in a software development kit. It is also part of the first release of Microsoft Visual Studio .NET (also known as Visual Studio .NET 2002).
- .NET Framework 1.0 RTM 1.0.3705.0
- .NET Framework 1.0 Sp1 1.0.3705.209
- .NET Framework 1.0 Sp2 1.0.3705.288
- .NET Framework 1.0 Sp3 1.0.3705.6018
.NET Framework 1.1
Full version number - 1.1.4322
This is the first major .NET Framework upgrade, released in April 2003. It is available on its own as a redistributable package or in a software development kit. It is also part of the second release of Microsoft Visual Studio .NET (released as Visual Studio .NET 2003). This is the first version of the .NET Framework to be included as part of the Windows operating system - it is part of Windows Server 2003.
- .NET Framework 1.1 RTM 1.1.4322.573
- .NET Framework 1.1 Sp1 1.1.4322.2032
- Windows 2003 RTM 1.1.4322.573
- Windows 2003 Service Pack 1 1.1.4322.2300
Changes since 1.0
- Built-in support for mobile ASP.NET controls. Previously available as an add-on for .NET Framework 1.0, now part of the framework.
- Security changes - enable Windows Forms assemblies to execute in a semi-trusted manner from the Internet, and enable code access security in ASP.NET applications.
- Built-in support for ODBC and Oracle databases. Previously available as an add-on for .NET Framework 1.0, now part of the framework.
- .NET Compact Framework - a version of the .NET Framework for small devices.
- Internet Protocol version 6 (IPv6) support.
- Numerous API changes. For a detailed list, see GotDotNet: API Changes between versions of the .NET Framework.
.NET Framework 2.0
Full version number - 2.0.50727.42 Released on November 7, 2005, along with Visual Studio 2005, SQL 2005 and BizTalk 2006.
- The 2.0 Redistributable Package can be downloaded for free from Microsoft.
- The 2.0 Software Development Kit (SDK) can be downloaded for free from Microsoft.
- It is included as part of Visual Studio 2005 and SQL Server 2005.
Changes since 1.1
- Numerous API changes. For a detailed list, see GotDotNet: API Changes between versions of the .NET Framework.
- A new hosting API for native applications wishing to host an instance of the .NET runtime. The new API gives a fine grain control on the behavior of the runtime with regards to multithreading, memory allocation, assembly loading and more (detailed reference). It was initially developed to efficiently host the runtime in Microsoft SQL Server, which implements its own scheduler and memory manager.
- Full 64-bit support for both the x64 and the IA64 hardware platforms.
- Language support for Generics built directly into the .NET CLR.
- A large number of other changes prompting Microsoft to consider much of the .NET framework part of the WinFX platform.
.NET Framework architecture
Image:Overview of the Common Language Infrastructure.png
Common Language Infrastructure (CLI)
The most important component of the .NET Framework lies in the Common Language Infrastructure, or CLI. The purpose of the CLI is to provide a language agnostic platform for application development, including, but not limited to, components for: exception handling, garbage collection, security, and interoperability. Microsoft's implementation of the CLI is called the Common Language Runtime, or CLR. The CLI is composed of five primary parts:
- Common Type System (CTS)
- Common Language Specification (CLS)
- Common Intermediate Language (CIL)
- Just-in-Time Compiler (JIT)
- Virtual Execution System (VES)
Assemblies
Code is housed in .NET assemblies, which for the Windows implementation means a Portable Executable (PE) file or DLL. Assemblies are the .NET unit of deployment, versioning and security. The assembly can be made up of one or more files, but one of these must contain the manifest, which has the metadata for the assembly. The complete name of an assembly contains its PE file name, version number, culture and public key token; it must contain the PE name, but the others are optional. The public key token is a 64 bit hash of the public key of a public-private key pair, and is used to ensure the uniqueness of the assembly name. An assembly that has a public key token is said to have a strong name. This naming scheme means that assemblies can be uniquely identified by the CLR, and when combined with the Global Assembly Cache, allows multiple versions of the same library to exist on the same machine without danger of the wrong version being loaded and without forcing developers to number correctly or intelligently place executables.
Metadata
All CIL is self-describing through .NET metadata. The CLR checks on metadata to ensure that the correct method is called. Metadata is usually generated by language compilers but developers can create their own metadata through custom attributes.
Base Class Library (BCL)
The Base Class Library (BCL), sometimes referred to as the Framework Class Library (FCL), is a library of types available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions such as file reading and writing, graphic rendering, database interaction, XML document manipulation, and so forth. The BCL is much larger than other libraries, but has much more functionality in one package.
Security
.NET has its own security mechanism, with two general features: code access security, and validation and verification. Code access security is based on evidence that is associated with a specific assembly. Typically the evidence is the source of the assembly (whether it is installed on the local machine, or has been downloaded from the intranet or Internet). Code access security uses evidence to determine the permissions granted to the code. Other code can demand that calling code is granted a specified permission. The demand causes the CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission and if any assembly is not granted the permission then a security exception is thrown.
When an assembly is loaded the CLR performs various tests. Two such tests are validation and verification. During validation the CLR checks that the assembly contains valid metadata and CIL, and it checks that the internal tables are correct. Verification is not so exact. The verification mechanism checks to see if the code does anything that is 'unsafe'. The algorithm used is quite conservative and hence sometimes code that is 'safe' is not verified. Unsafe code will only be executed if the assembly has the 'skip verification' permission, which generally means code that is installed on the local machine.
.NET technology
Windows Forms
Windows Forms, or WinForms, is the portion of the .NET Framework that provides managed wrappers for the widgets contained in the existing Win32 API.
ASP.NET
ASP.NET, the Microsoft replacement for classic Active Server Pages (ASP) web programming technology, implements .NET and has a .NET class library. ASP.NET, as with all other .NET technologies is completely language independent. ASP.NET 2.0 is a monumental upgrade for ASP.NET including many "boiler-plate" controls to dramatically reduce the amount of code a developer writes. The design of ASP.NET 2.0 followed the overall .NET redesign task: Micosoft's goal and claim was that it would allow developers to write 70% less code compared to what would be required for .NET 1.x.
ADO.NET
ADO.NET is a new version of ActiveX Data Objects (ADO) for the .NET framework. Extensible Markup Language (XML) plays an important role as procedures(RPC) are provided to serialize data objects as XML data.
.NET Remoting
Template:Expandsection The .NET remoting infrastructure is an abstract approach to interprocess communication.
Web Services
XML Web services are the Microsoft implementation of SOAP.
.NET languages
At the core of the .NET Framework sits Microsoft's implementation of the language agnostic CLI, the CLR, which executes the intermediate language MSIL. Because the runtime engine is based on an intermediate language, any source code compiler that emits MSIL can be used to create assemblies which can be executed by the CLR. The CLR, then, supports both object-oriented and procedural languages.
While there are currently over 40 languages with compilers for the .NET Framework, only a small number of them are widely used and supported by Microsoft. The remainder is composed of languages developed by third party vendors. Because of the specific requirements of CLR compatibility, many of the alternative languages underwent vast changes to not only meet these requirements, but also to improve many other aspects of the language's implementation. Most of these alternative languages provide free compilers and some of the vendors even sell IDEs.
Although Microsoft's Common Language Runtime explicitly supports multiple languages, there are several projects that enable the Java Runtime Environment to run other languages, either interpreted (see the List of Java scripting languages) or compiled to Java bytecode. See this quite comprehensive page listing languages for the Java VM. This allows developers using those languages to leverage the portability of the Java platform.
Microsoft supported languages
- C# - Microsoft's flagship .NET Framework language which bears similarities to the [[C++]] and Java languages.
- Visual Basic .NET - A completely redesigned version of the Visual Basic language for the .NET Framework.
- [[C++/CLI]] and the deprecated [[Managed Extensions for C++|Managed C++]] - A managed version of the [[C++]] language.
- J# - A Java and [[J++]] .NET transitional language.
- JScript .NET - A compiled version of the JScript language.
- Eiffel - The Eiffel method language.
Alternative languages
|
|
Standardization and Licensing
In August, 2000, Microsoft, Hewlett-Packard, and Intel worked to standardize CLI and the C# programming language. By December, 2001, both were ratified ECMA standards (ECMA 335 and ECMA 334). ISO followed in April, 2003 (ISO/IEC 23271 and ISO/IEC 23270).
This is a calculated risk, but it may encourage standards-compliant implementations, to provide an ongoing bridge for non-Windows software to be converted to Microsoft .NET. One group promoting this as a standard is the International .NET Association (INETA).
While Microsoft and their partners hold patents for CLI and C#, ECMA and ISO requires that all patents essential to implementation be made available under "reasonable and non-discriminatory (RAND) terms." The companies have agreed, instead, to make the patents available under "royalty-free and otherwise RAND terms."
.NET vs. Java EE
The CLI, the CIL, and C# have similarities to Sun's JVM and Java; hence, they are fierce competitors. Both use their own intermediate byte-code, Microsoft calling theirs Microsoft Intermediate Language (MSIL). MSIL is designed for just-in-time compilation (JITting), while Java bytecode originally was designed to be interpreted, not JITted (However Sun's HotSpot is a successful JIT implementation of Java). .NET is currently only fully available on Windows platforms, whereas Java is fully available on many platforms. However, Microsoft did release source code for portions of the .NET framework, including the C++ source code for some of their CLR. This forms the basis of the Shared source CLI. It along with other implementations currently in progress such as Portable.NET, Mono can be used to run some .NET applications on Unix-like operating systems such as Linux, FreeBSD, and Mac OS X. Java EE provides much more functionality then the .NET framework and other Microsoft technologies such as COM+ (previously MTS) and MSMQ.
More cooperation is possible with the software "IKVM", which is an implementation of the Java Virtual Machine in .NET.
Java has an alternative implementation of remote procedure calls and network transparency called remote method invocation (RMI). RMI in its "RMI over IIOP" (RMI-IIOP) variant is also compatible with CORBA.
.NET vs. COM
- This is not to be confused with the domain names .com and .net.
The previous software component technology endorsed by Microsoft for large-scale software systems was Component Object Model (COM), using COM+ or MTS enhancements for distributed transactional components. While .NET may wrap COM-objects and vice versa, Microsoft called it Runtime Callable Wrapper (RCW) and COM Callable Wrapper (CCW) respectively, it has been clearly stated by Microsoft that .NET will eventually replace COM as a software component architecture. Microsoft hopes that developers writing new applications for the Win32 platform start using .NET instead of COM, with use of existing services via abstracted interfaces (e.g. transactional .NET components currently use COM+).
In the early creation of .NET, the .NET team was not focused on creating a new platform, but in fact initially set out to create COM+ 2.5.
Alternative implementations
While the Microsoft .NET Framework is the flagship implementation of .NET technologies, there exist other implementations.
- Microsoft's Shared Source Common Language Infrastructure is a shared source implementation of the .NET Framework by Microsoft. It runs on Microsoft Windows XP, FreeBSD, and Mac OS X 10.2.
- DotGNU aims to be for webservices and for C# programs what GNU/Linux is rapidly becoming for desktop and server applications: the industry leader and provider of Free Software solutions. Portable.NET is an implementation of the Common Language Infrastructure (CLI), more commonly known as .NET, includes everything that you need to compile and run C# and C applications that use the base class libraries, XML, and Systems.Windows.Forms. Currently supported CPUs: x86, PPC, ARM, PARISC, s390, ia-64, Alpha, MIPS, Sparc. Supported operating systems: GNU/Linux (on PCs, Sparc, iPAQ, Sharp Zaurus, PlayStation 2, Xbox,...), *BSD, Cygwin/Mingw32, Mac OS X, Solaris, AIX.
- Mono is an implementation of the .NET runtime and development libraries dual-licensed under free software and proprietary software licenses. Mono is being developed by Novell, Inc.. It includes support for ASP.NET, ADO.NET, and evolving support for Windows Forms libraries. It also includes a C# compiler and a VB.NET compiler is in pre-beta form. Mono includes the development of new libraries, which include:
- Gtk#: A .NET wrapper for the [[GTK+]] GUI toolkit.
- XSP: A web server written in C# with support for hosting ASP.NET applications.
- MonoDevelop: A port of SharpDevelop, a GPLed IDE for .NET, to Gtk# and Mono.
- Novell.Directory.Ldap class libraries: A free implementation of Lightweight Directory Access Protocol (LDAP) for .NET.
- SerialPortNet: A serial port library for .Net & Mono implementing .NET 2.0 specifications.
See also
External links
- microsoft.com - .NET Framework Developer Center
- asp.net - Official ASP.NET resource website
- windowsforms.com - Official WinForms resource website
- gotdotnet.com - Microsoft .NET Framework Community
Template:Microsoft productscs:.NET da:.NET (Microsoft) de:.NET es:.NET fr:Microsoft .NET hr:.net it:Microsoft .NET he:.NET hu:Microsoft .NET nl:.NET ja:.NET no:.NET pl:.NET pt:Microsoft .NET ru:Microsoft .NET sl:Microsoft .NET sv:.NET tr:NoktaNet zh:微软.NET