|Initial release||13 February 2002|
|Stable release||4.5.2 (4.5.51209.34209) / 6 May 2014|
|Operating system||Windows 98 or later, Windows NT 4.0 or later|
|License||Proprietary; FCL under Microsoft Reference Source License|
.NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library known as Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (as contrasted to hardware environment), known as Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. FCL and CLR together constitute .NET Framework.
FCL provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. Programmers produce software by combining their own source code with .NET Framework and other libraries. .NET Framework is intended to be used by most new applications created for Windows platform. Microsoft also produces an integrated development environment largely for .NET software called Visual Studio.
Microsoft started development of .NET Framework in the late 1990s, originally under the name of Next Generation Windows Services (NGWS). By late 2000, the first beta versions of .NET 1.0 were released.
Version 3.0 of .NET Framework is included with Windows Server 2008 and Windows Vista. Version 3.5 is included with Windows 7 and Windows Server 2008 R2, and can also be installed on Windows XP and Windows Server 2003. Version 4.5 is included with Windows 8 and Windows Server 2012. Windows XP was delivered without any versions of .NET Framework.
.NET Framework family also includes two versions for mobile or embedded device use. A reduced version of the framework, .NET Compact Framework, is available on Windows CE platforms, including Windows Mobile devices such as smartphones. Additionally, .NET Micro Framework is targeted at severely resource-constrained devices.
|Development tool||Windows||Windows Server|
|1.0||1.0||2002-02-13||Visual Studio .NET||N/A||N/A||N/A|
|1.1||1.1||2003-04-24||Visual Studio .NET 2003||N/A||2003||1.0|
|2.0||2.0||2005-11-07||Visual Studio 2005||N/A||2003, 2008 SP2, 2008 R2 SP1||N/A|
|3.0||2.0||2006-11-06||Expression Blend[a]||Vista||2008 SP2, 2008 R2 SP1||2.0|
|3.5||2.0||2007-11-19||Visual Studio 2008||7, 8[b], 8.1[b]||2008 R2 SP1||2.0, 3.0|
|4.0||4||2010-04-12||Visual Studio 2010||N/A||N/A||N/A|
|4.5||4||2012-08-15||Visual Studio 2012||8||2012||4.0|
|4.5.1||4||2013-10-17||Visual Studio 2013||8.1||2012 R2||4.0, 4.5|
|4.5.2||4||2014-05-05||N/A||10 (technical preview)||N/A||4.0, 4.5, 4.5.1|
- a.^ Expression Blend only covers the Windows Presentation Foundation part of .NET Framework 3.0.
- b.^ ^ .NET Framework 3.5 is not installed along with Windows 8 or Windows 8.1. It must be installed either from a Windows installation media or from the Internet. Control Panel always attempts the latter.
- Because computer systems commonly require interaction between newer and older applications, .NET Framework provides means to access functionality implemented in newer and older programs that execute outside .NET environment. Access to COM components is provided in
System.EnterpriseServicesnamespaces of the framework; access to other functionality is achieved using the P/Invoke feature.
- Common Language Runtime engine
- Common Language Runtime (CLR) serves as the execution engine of .NET Framework. All .NET programs execute under the supervision of CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling.
- Language independence
- .NET Framework introduces a Common Type System, or CTS. CTS specification defines all possible datatypes and programming constructs supported by CLR and how they may or may not interact with each other conforming to Common Language Infrastructure (CLI) specification. Because of this feature, .NET Framework supports the exchange of types and object instances between libraries and applications written using any conforming .NET language.
- Framework Class Library
- Framework Class Library (FCL) is a library of functionality available to all languages using .NET Framework. FCL provides classes that encapsulate a number of common functions, including file reading and writing, graphic rendering, database interaction, XML document manipulation, and so on. It consists of classes, interfaces of reusable types that integrates CLR.
- Simplified deployment
- .NET Framework includes design features and tools which help manage the installation of computer software to ensure that it does not interfere with previously installed software, and that it conforms to security requirements.
- The design addresses some of the vulnerabilities, such as buffer overflows, which have been exploited by malicious software. Additionally, .NET provides a common security model for all applications.
- While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be platform-agnostic, and cross-platform implementations are available for other operating systems (see Silverlight and § Alternative implementations). Microsoft submitted the specifications for CLI (which includes the core class libraries, CTS, and the Common Intermediate Language), C#, and C++/CLI to both ECMA and ISO, making them available as official standards. This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms.
Common Language Infrastructure (CLI)
The purpose of CLI is to provide a language-neutral platform for application development and execution, including functions for exception handling, garbage collection, security, and interoperability. By implementing the core aspects of .NET Framework within the scope of CLI, this functionality will not be tied to a single language but will be available across the many languages supported by the framework. Microsoft's implementation of CLI is CLR.
Common Intermediate Language (CIL) code is housed in CLI assemblies. As mandated by the specification, assemblies are stored in Portable Executable (PE) format, common on Windows platform for all DLL and EXE files. The assembly consists of one or more files, one of which must contain the manifest, which has the metadata for the assembly. The complete name of an assembly (not to be confused with the filename on disk) contains its simple text name, version number, culture, and public key token. Assemblies are considered equivalent if they share the same complete name, excluding the revision of the version number. A private key can also be used by the creator of the assembly for strong naming. The public key token identifies which private key an assembly is signed with. Only the creator of the keypair (typically .NET developer signing the assembly) can sign assemblies that have the same strong name as a previous version assembly, since the creator is in possession of the private key. Strong naming is required to add assemblies to Global Assembly Cache.
.NET has its own security mechanism with two general features: Code Access Security (CAS), and validation and verification. CAS 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). CAS uses evidence to determine the permissions granted to the code. Other code can demand that calling code be granted a specified permission. The demand causes CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission; if any assembly is not granted the permission a security exception is thrown.
|Namespaces in the FCL|
.NET Framework includes a set of standard class libraries. The class library is organized in a hierarchy of namespaces. Most of the built-in APIs are part of either
Microsoft.* namespaces. These class libraries implement a large number of common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation, among others. .NET class libraries are available to all CLI compliant languages. .NET Framework class library is divided into two parts: FCL and Base Class Library (BCL).
FCL includes a small subset of the entire class library and is the core set of classes that serve as the basic API of CLR. Classes in
mscorlib.dll and some classes in
System.core.dll are part of FCL. FCL classes are available in .NET Framework as well as its alternative implementations including .NET Compact Framework, Microsoft Silverlight and Mono.
BCL is a superset of FCL and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including Windows Forms, ADO.NET, ASP.NET, Language Integrated Query, Windows Presentation Foundation, Windows Communication Foundation among others. BCL is much larger in scope than standard libraries for languages like C++, and comparable in scope to standard libraries of Java.
CLR frees the developer from the burden of managing memory (allocating and freeing up when done); it handles memory management itself by detecting when memory can be safely freed. Instantiations of .NET types (objects) are allocated from the managed heap; a pool of memory managed by CLR. As long as there exists a reference to an object, which might be either a direct reference to an object or via a graph of objects, the object is considered to be in use. When there is no reference to an object, and it cannot be reached or used, it becomes garbage, eligible for collection. .NET Framework includes a garbage collector which runs periodically, on a separate thread from the application's thread, that enumerates all the unusable objects and reclaims the memory allocated to them.
.NET Garbage Collector (GC) is a non-deterministic, compacting, mark-and-sweep garbage collector. GC runs only when a certain amount of memory has been used or there is enough pressure for memory on the system. Since it is not guaranteed when the conditions to reclaim memory are reached, GC runs are non-deterministic. Each .NET application has a set of roots, which are pointers to objects on the managed heap (managed objects). These include references to static objects and objects defined as local variables or method parameters currently in scope, as well as objects referred to by CPU registers. When GC runs, it pauses the application, and for each object referred to in the root, it recursively enumerates all the objects reachable from the root objects and marks them as reachable. It uses CLI metadata and reflection to discover the objects encapsulated by an object, and then recursively walk them. It then enumerates all the objects on the heap (which were initially allocated contiguously) using reflection. All objects not marked as reachable are garbage. This is the mark phase. Since the memory held by garbage is not of any consequence, it is considered free space. However, this leaves chunks of free space between objects which were initially contiguous. The objects are then compacted together to make used memory contiguous again. Any reference to an object invalidated by moving the object is updated by GC to reflect the new location. The application is resumed after the garbage collection is over.
GC used by .NET Framework is also generational. Objects are assigned a generation; newly created objects belong to Generation 0. The objects that survive a garbage collection are tagged as Generation 1, and the Generation 1 objects that survive another collection are Generation 2 objects. .NET Framework uses up to Generation 2 objects. Higher generation objects are garbage collected less frequently than lower generation objects. This helps increase the efficiency of garbage collection, as older objects tend to have a longer lifetime than newer objects. Thus, by eliminating older (and thus more likely to survive a collection) objects from the scope of a collection run, fewer objects need to be checked and compacted.
Standardization and licensing
In August 2000, Microsoft, Hewlett-Packard, and Intel worked to standardize CLI and C#. By December 2001, both were ratified ECMA standards. ISO followed in April 2003. The current version of ISO standards are ISO/IEC 23271:2012 and ISO/IEC 23270:2006.
While Microsoft and their partners hold patents for CLI and C#, ECMA and ISO require that all patents essential to implementation be made available under "reasonable and non-discriminatory terms". In addition to meeting these terms, the companies have agreed to make the patents available royalty-free. However, this does not apply for the part of .NET Framework which is not covered by ECMA/ISO standard, which includes Windows Forms, ADO.NET, and ASP.NET. Patents that Microsoft holds in these areas may deter non-Microsoft implementations of the full framework.
On 3 October 2007, Microsoft announced that much of the source code for .NET Framework Framework Class Library (including ASP.NET, ADO.NET, and Windows Presentation Foundation) was to have been made available with the final release of Visual Studio 2008 towards the end of 2007 under the shared source Microsoft Reference License. The source code for other libraries including Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Language Integrated Query (LINQ) were to be added in future releases. Being released under the closed-source Microsoft Reference License means this source code is made available for debugging purpose only, primarily to support integrated debugging of FCL in Visual Studio.
.NET Framework is the predominant implementation of .NET technologies. Other implementations for parts of the framework exist. Although the runtime engine is described by an ECMA/ISO specification, other implementations of it may be encumbered by patent issues; ISO standards may include the disclaimer, "Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO shall not be held responsible for identifying any or all such patent rights." It is more difficult to develop alternatives to FCL, which is not described by an open standard and may be subject to copyright restrictions. Additionally, parts of FCL have Windows-specific functionality and behavior, so implementation on non-Windows platforms can be problematic.
Some alternative implementations of parts of the framework are listed here.
- .NET Micro Framework is a .NET platform for extremely resource-constrained devices. It includes a small version of CLR and supports development in C# (though some developers were able to use VB.NET, albeit with an amount of hacking, and with limited functionalities) and debugging (in an emulator or on hardware), both using Microsoft Visual Studio. It also features a subset of .NET Framework Class Library (about 70 classes with about 420 methods), a GUI framework loosely based on Windows Presentation Foundation, and additional libraries specific to embedded applications.
- Mono is an implementation of CLI and FCL, and provides additional functionality. It is dual-licensed under free software and proprietary software licenses. It includes support for ASP.NET, ADO.NET, and Windows Forms libraries for a wide range of architectures and operating systems. It also includes C# and VB.NET compilers.
- Portable.NET (part of DotGNU) provides an implementation of CLI, portions of FCL, and a C# compiler. It supports a variety of CPUs and operating systems.
- Microsoft Shared Source Common Language Infrastructure is a non-free implementation of CLR. However, the last version only runs on Microsoft Windows XP SP2, and was not updated since 2006, therefore it does not contain all features of version 2.0 of .NET Framework.
- CrossNet is an implementation of CLI and portions of FCL. It is free software using the open source MIT License.
The garbage collector, which is integrated into the environment, can introduce unanticipated delays of execution over which the developer has little direct control. "In large applications, the number of objects that the garbage collector needs to deal with can become very large, which means it can take a very long time to visit and rearrange all of them."
.NET Framework provides support for calling Streaming SIMD Extensions (SSE) via managed code from April 2014 in Visual Studio 2013 Update 2. However, Mono has provided support for SIMD Extensions as of version 2.2 within the Mono.Simd namespace; before. Mono's lead developer Miguel de Icaza has expressed hope that this SIMD support will be adopted by CLR's ECMA standard. Streaming SIMD Extensions have been available in x86 CPUs since the introduction of the Pentium III. Some other architectures such as ARM and MIPS also have SIMD extensions. In case the CPU lacks support for those extensions, the instructions are simulated in software.
Unobfuscated managed CIL bytecode can often be easier to reverse-engineer than native code. NET decompiler programs enable developers with no reverse-engineering skills to view the source code behind unobfuscated .NET assemblies (DLL/EXE). In contrast, applications built with Visual C++ are much harder to reverse-engineer and source code is almost never produced successfully, mainly due to compiler optimizations and lack of reflection. One concern is over possible loss of trade secrets and the bypassing of license control mechanisms. To mitigate this, Microsoft has included Dotfuscator Community Edition with Visual Studio .NET since 2002. Third-party obfuscation tools are also available from vendors such as vmware, V.i. Labs, Xenocode, Red Gate Software. Method-level encryption tools for .NET code are available from vendors such as SafeNet.
- Scott Guthrie (3 October 2007). "Releasing the Source Code for the NET Framework". Archived from the original on 7 September 2010. Retrieved 15 September 2010.
- ".NET Framework 3.5 Deployment Guide for Administrators". MSDN. Microsoft. Retrieved 26 June 2008.
- Chen, Raymond (4 April 2011). "Windows is not a .NET Framework delivery channel either". Retrieved 17 June 2014.
- ".NET Framework Versions and Dependencies". MSDN. Microsoft. Retrieved 17 January 2014.
- "What's New in Visual Studio .NET 2003". MSDN. Microsoft. Retrieved 1 September 2014. "Visual Studio .NET 2002 shipped with the Microsoft .NET Framework SDK version 1.0. Visual Studio .NET 2003 ships with .NET Framework SDK version 1.1."
- ".NET Framework Developer Center – Frequently Asked Questions". Archived from the original on July 24, 2012.
- "What's New in Visual Studio 2005". MSDN. Microsoft. Retrieved 1 September 2014.
- Chinnathambi, Kirupa (4 December 2006). "Expression Blend -- What Is That?". Expression Blend and Design. Microsoft. Retrieved 1 September 2014.
- Guthrie, Scott (19 November 2007). "Visual Studio 2008 and .NET 3.5 Released". Scott Gu's Blog. Microsoft. Retrieved 1 September 2014.
- "What's New in Visual Studio 2010". MSDN. Microsoft. Retrieved 1 September 2014.
- "What's New in Visual Studio 2012". MSDN. Microsoft. Retrieved 1 September 2014.
- "What's New in Visual Studio 2013". MSDN. Microsoft. Retrieved 1 September 2014.
- "Installing the .NET Framework 3.5 on Windows 8 or 8.1". MSDN. Microsoft. Retrieved 13 August 2014.
- "Scott Guthrie: Silverlight and the Cross-Platform CLR". Channel 9. 30 April 2007.
- "ECMA 335 - Standard ECMA-335 Common Language Infrastructure (CLI)". ECMA. 1 June 2006. Archived from the original on 14 June 2008. Retrieved 1 June 2008.
- "ISO/IEC 23271:2006". Standards.iso.org. 2006-09-29. Retrieved 2012-04-17.
- "Technical Report TR/84 Common Language Infrastructure (CLI) - Information Derived from Partition IV XML File". ECMA. 1 June 2006.
- "ECMA-334 C# Language Specification". ECMA. 1 June 2006.
- "Standard ECMA-372 C++/CLI Language Specification". ECMA. 1 December 2005.
- "Base Class Library". Retrieved 1 June 2008.
- "Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework". Archived from the original on 3 July 2007. Retrieved 1 June 2008.
- "Garbage collection in .NET". Archived from the original on 25 May 2008. Retrieved 1 June 2008.
- "Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework". Archived from the original on 26 June 2007. Retrieved 1 June 2008.
- "Standard ECMA-335: Common Language Infrastructure (CLI)". ecma-international.org (6 ed.). ECMA. June 2012.
- "Standard ECMA-334: C# Language Specification". ecma-international.org (4 ed.). ECMA. June 2006.
- "ISO/IEC 23271:2012 Information technology - Common Language Infrastructure (CLI)". iso.org (3 ed.). International Organization for Standardization. 13 February 2012.
- "ISO/IEC 23270:2006 - Information technology - Programming languages - C#". iso.org (2 ed.). International Organization for Standardization. 26 January 2012.
- "Microsoft's Empty Promise". Free Software Foundation. 16 July 2009. Archived from the original on 5 August 2009. Retrieved 3 August 2009. "However, there are several libraries that are included with Mono, and commonly used by applications like Tomboy, that are not required by the standard. And just to be clear, we're not talking about Windows-specific libraries like ASP.NET and Windows Forms. Instead, we're talking about libraries under the System namespace that provide common functionality programmers expect in modern programming languages"
- ISO 9001:2008, Foreword
- "Using VB.NET with the .NET Micro Framework « /dev/mobile". Christec.co.nz. 2008-04-01. Retrieved 2012-04-17.
- "CrossNet". Codeplex.com. Retrieved 2012-04-17.
- "Understanding Garbage Collection in .NET".
- "''Mono's SIMD Support: Making Mono safe for Gaming''". Tirania.org. 2008-11-03. Retrieved 2012-04-17.
- "Reverse Engineering Risk Assessment".
- Gartner, Inc. as reported in "Hype Cycle for Cyberthreats, 2006", September 2006, Neil MacDonald; Amrit Williams, et al.
- Dotfuscator Community Edition 4.0
|Wikibooks has a book on the topic of: .NET Development Foundation|
|Wikiversity has learning materials about Introduction to Microsoft.NET|
- Official website
- .NET Framework Index
- Overview of .NET Framework (MSDN)
- .NET Framework FAQ
- Why .Net Framework For Business Solution (Infographics)