.NET Framework: Difference between revisions
No edit summary Tags: Reverted Mobile edit Mobile web edit |
KevinBlue18 (talk | contribs) m Grammar fixes: removed punctuation and added preposition (the comma after "Microsoft" is not needed because "Microsoft and Intel" is a compound subject, and added the preposition "by" after the verb "ratified") Tags: Visual edit Mobile edit Mobile web edit Advanced mobile edit |
||
(25 intermediate revisions by 23 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Software platform developed by Microsoft}} |
{{Short description|Software platform developed by Microsoft}} |
||
{{for multi|the newer cross-platform framework|.NET|other uses|.net ( |
{{for multi|the newer cross-platform framework|.NET|other uses|.net (disambiguation)}} |
||
{{Use American English|date=July 2022}} |
{{Use American English|date=July 2022}} |
||
{{Use mdy dates|date=September 2018}} |
{{Use mdy dates|date=September 2018}} |
||
Line 6: | Line 6: | ||
| name = .NET Framework |
| name = .NET Framework |
||
| logo = Microsoft .NET logo.svg |
| logo = Microsoft .NET logo.svg |
||
| logo size = |
| logo size = 120px |
||
| screenshot = |
| screenshot = DotNet.svg |
||
| screenshot size = 252 |
|||
| caption = .NET Framework component stack |
| caption = .NET Framework component stack |
||
| developer = [[Microsoft]] |
| developer = [[Microsoft]] |
||
| released = {{Start date and age|2002|02|13}} |
| released = {{Start date and age|2002|02|13}} |
||
| discontinued = yes |
|||
| latest release version = 4.8.1 |
| latest release version = 4.8.1 |
||
| latest release date = {{Start date and age|2022|08|09}}<ref>{{Cite web|url=https://dotnet.microsoft.com/download/thank-you/net48-offline|title=Download .NET Framework 4.8 Offline Installer|website=Microsoft|access-date=August 15, 2019|archive-date=August 15, 2019|archive-url=https://web.archive.org/web/20190815224743/https://dotnet.microsoft.com/download/thank-you/net48-offline|url-status=live}}</ref> |
| latest release date = {{Start date and age|2022|08|09}}<ref>{{Cite web|url=https://dotnet.microsoft.com/download/thank-you/net48-offline|title=Download .NET Framework 4.8 Offline Installer|website=Microsoft|access-date=August 15, 2019|archive-date=August 15, 2019|archive-url=https://web.archive.org/web/20190815224743/https://dotnet.microsoft.com/download/thank-you/net48-offline|url-status=live}}</ref> |
||
Line 18: | Line 16: | ||
| operating system = [[Windows 98]] or later, [[Windows NT 4.0]] or later |
| operating system = [[Windows 98]] or later, [[Windows NT 4.0]] or later |
||
| platform = [[IA-32]], [[x86-64]], and [[ARM architecture|ARM]] |
| platform = [[IA-32]], [[x86-64]], and [[ARM architecture|ARM]] |
||
| included with = [[Microsoft Windows]] |
|||
| genre = [[Software framework]] |
| genre = [[Software framework]] |
||
| license = Mixed; see {{section link||Licensing}} |
| license = Mixed; see {{section link||Licensing}} |
||
| website = <!-- no need to specify here... it is in WikiData --> |
| website = <!-- no need to specify here... it is in WikiData --> |
||
}} |
}} |
||
The '''.NET Framework''' (pronounced as "''dot net |
The '''.NET Framework''' (pronounced as "''dot net''") is a proprietary [[software framework]] developed by [[Microsoft]] that runs primarily on [[Microsoft Windows]]. It was the predominant implementation of the [[Common Language Infrastructure]] (CLI) until being superseded by the cross-platform [[.NET]] project. It includes a large [[class library]] called [[Framework Class Library]] (FCL) and provides [[language interoperability]] (each language can use code written in other languages) across several [[programming language]]s. Programs written for .NET Framework execute in a [[software]] environment (in contrast to a [[computer hardware|hardware]] environment) named the [[Common Language Runtime]] (CLR). The CLR is an [[process virtual machine|application virtual machine]] that provides services such as security, [[memory management]], and [[exception handling]]. As such, computer code written using .NET Framework is called "[[managed code]]". FCL and CLR together constitute the .NET Framework. |
||
FCL provides the [[user interface]], [[data access]], [[database connection|database connectivity]], [[cryptography]], [[web application]] development, numeric [[algorithm]]s, and [[computer networking|network communications]]. Programmers produce software by combining their [[source code]] with .NET Framework and other libraries. The framework is intended to be used by most new applications created for the Windows platform. Microsoft also produces an [[integrated development environment]] for .NET software called [[Microsoft Visual Studio|Visual Studio]]. |
FCL provides the [[user interface]], [[data access]], [[database connection|database connectivity]], [[cryptography]], [[web application]] development, numeric [[algorithm]]s, and [[computer networking|network communications]]. Programmers produce software by combining their [[source code]] with the .NET Framework and other libraries. The framework is intended to be used by most new applications created for the Windows platform. Microsoft also produces an [[integrated development environment]] for .NET software called [[Microsoft Visual Studio|Visual Studio]]. |
||
.NET Framework began as [[proprietary software]], although the firm worked to [[software standard|standardize]] the software stack almost immediately, even before its first release. Despite the standardization efforts, developers, mainly those in the [[free and open-source software]] communities, expressed their unease with the selected terms and the prospects of any free and open-source implementation, especially regarding [[software patent]]s. Since then, Microsoft has changed .NET development to more closely follow a contemporary model of a community-developed software project, including issuing an update to its patent promising to address the concerns.<ref>{{Cite web|date=November 19, 2014 |title=Microsoft gets on board with open source|url=https://opensource.com/business/14/11/microsoft-dot-net-empower-open-source-communities|access-date=2020-01-02|website=Opensource.com|language=en}}</ref> |
.NET Framework began as [[proprietary software]], although the firm worked to [[software standard|standardize]] the software stack almost immediately, even before its first release. Despite the standardization efforts, developers, mainly those in the [[free and open-source software]] communities, expressed their unease with the selected terms and the prospects of any free and open-source implementation, especially regarding [[software patent]]s. Since then, Microsoft has changed .NET development to more closely follow a contemporary model of a community-developed software project, including issuing an update to its patent promising to address the concerns.<ref>{{Cite web |date=November 19, 2014 |title=Microsoft gets on board with open source |url=https://opensource.com/business/14/11/microsoft-dot-net-empower-open-source-communities |access-date=2020-01-02 |website=Opensource.com |language=en |first1=Luis |last1=Ibanez |archive-date=January 2, 2020 |archive-url=https://web.archive.org/web/20200102202811/https://opensource.com/business/14/11/microsoft-dot-net-empower-open-source-communities |url-status=live }}</ref> |
||
In April 2019, Microsoft released .NET Framework 4.8, the last version of the framework as a proprietary offering. Only monthly security and reliability bug fixes to that version have been released since then. No further changes to that version are planned.<ref>{{Cite web|last=gewarren|title=.NET Framework & Windows OS versions|url=https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies|access-date=2020-11-21|website=docs.microsoft.com |
In April 2019, Microsoft released .NET Framework 4.8, the last major version of the framework as a proprietary offering, followed by .NET Framework 4.8.1 in August 2022. Only monthly security and reliability [[software bug|bug]] fixes to that version have been released since then. No further changes to that version are planned. The .NET Framework will continue to be included with future releases of Windows and continue to receive security updates, with no plans to remove it as of November 2023.<ref>{{Cite web|last=gewarren|title=.NET Framework & Windows OS versions|url=https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies|access-date=2020-11-21|website=Microsoft Learn|language=en-us|archive-date=September 3, 2022|archive-url=https://web.archive.org/web/20220903043259/https://docs.microsoft.com/en-US/dotnet/framework/migration-guide/versions-and-dependencies|url-status=live}}</ref> |
||
==History== |
==History== |
||
Line 34: | Line 33: | ||
Microsoft began developing .NET Framework in the late 1990s, originally under the name of Next Generation Windows Services (NGWS), as part of the [[.NET strategy]]. By early 2000, the first beta versions of .NET 1.0 were released. |
Microsoft began developing .NET Framework in the late 1990s, originally under the name of Next Generation Windows Services (NGWS), as part of the [[.NET strategy]]. By early 2000, the first beta versions of .NET 1.0 were released. |
||
In August 2000, [[Microsoft]] |
In August 2000, [[Microsoft]] and [[Intel]] worked to standardize [[Common Language Infrastructure]] (CLI) and [[C Sharp (programming language)|C#]]. By December 2001, both were ratified [[Ecma International|by ECMA]] standards.<ref>{{cite web|url=http://www.ecma-international.org/publications/standards/Ecma-335.htm|title=Standard ECMA-335: Common Language Infrastructure (CLI)|date=June 2012|publisher=[[Ecma International|ECMA]]|edition=6|access-date=August 31, 2005|archive-date=June 29, 2013|archive-url=https://web.archive.org/web/20130629235609/http://www.ecma-international.org/publications/standards/Ecma-335.htm|url-status=dead}}</ref><ref name="Ecma-334">{{cite web|url=http://www.ecma-international.org/publications/standards/Ecma-334.htm|title=Standard ECMA-334: C# Language Specification|date=June 2006|publisher=[[Ecma International|ECMA]]|edition=4|access-date=August 31, 2005|archive-date=October 31, 2010|archive-url=https://web.archive.org/web/20101031042906/http://www.ecma-international.org/publications/standards/Ecma-334.htm|url-status=dead }}</ref> [[International Organization for Standardization]] (ISO) followed in April 2003. The current version of ISO standards are ISO/IEC 23271:2012 and ISO/IEC 23270:2006.<ref>{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=58046|title=ISO/IEC 23271:2012 Information technology – Common Language Infrastructure|publisher=[[International Organization for Standardization]]|date=February 13, 2012|edition=3|access-date=March 17, 2012|archive-date=March 17, 2012|archive-url=https://web.archive.org/web/20120317142950/http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=58046|url-status=live}}</ref><ref>{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=42926|title=ISO/IEC 23270:2006 – Information technology – Programming languages – C#|publisher=[[International Organization for Standardization]]|date=January 26, 2012 |edition=2|access-date=April 1, 2008|archive-date=December 6, 2010|archive-url=https://web.archive.org/web/20101206152217/http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=42926|url-status=live}}</ref> |
||
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 licensing|reasonable and non-discriminatory terms]]". The firms agreed to meet these terms, and to make the patents available royalty-free. However, this did not apply to the part of the .NET Framework not covered by ECMA-ISO standards, which included [[Windows Forms]], [[ADO.NET]], and [[ASP.NET]]. Patents that Microsoft holds in these areas may have deterred non-Microsoft implementations of the full framework.<ref>{{cite web|title=Microsoft's Empty Promise|url=http://www.fsf.org/news/2009-07-mscp-mono|work=[[Free Software Foundation]]|date=July 16, 2009|quote=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|access-date=August 3, 2009|archive-url=https://web.archive.org/web/20090819101829/http://www.fsf.org/news/2009-07-mscp-mono/|archive-date=August 19, 2009|url-status=live|df=dmy}}</ref> |
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 licensing|reasonable and non-discriminatory terms]]". The firms agreed to meet these terms, and to make the patents available royalty-free. However, this did not apply to the part of the .NET Framework not covered by ECMA-ISO standards, which included [[Windows Forms]], [[ADO.NET]], and [[ASP.NET]]. Patents that Microsoft holds in these areas may have deterred non-Microsoft implementations of the full framework.<ref>{{cite web|title=Microsoft's Empty Promise|url=http://www.fsf.org/news/2009-07-mscp-mono|work=[[Free Software Foundation]]|date=July 16, 2009 |first1=Brett |last1=Smith |quote=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|access-date=August 3, 2009|archive-url=https://web.archive.org/web/20090819101829/http://www.fsf.org/news/2009-07-mscp-mono/|archive-date=August 19, 2009|url-status=live|df=dmy}}</ref> |
||
[[Windows Vista]] is the first client version of Windows that integrated the .NET Framework. |
|||
⚫ | On October 3, 2007, Microsoft announced that the [[source code]] for .NET Framework 3.5 libraries was to become available under the [[Microsoft Reference Source License]] (Ms-RSL{{efn|name=Ms-RSL-dab|The license was formerly abbreviated Ms-RL, but Ms-RL now refers to the [[Microsoft Reciprocal License]].}}).<ref name="sourcerelease">{{cite web|url=http://weblogs.asp.net/scottgu/releasing-the-source-code-for-the-net-framework-libraries|title=Releasing the Source Code for the NET Framework|website=Scott Guthrie's Blog|publisher=[[Microsoft]]|first=Scott|last=Guthrie|author-link=Scott Guthrie|date=October 3, 2007|access-date=September 15, 2010|archive-url=https://web.archive.org/web/20100907233621/http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx|archive-date=September 7, 2010|url-status=live|df=dmy}}</ref> The source code repository became available online on January 16, 2008, and included BCL, ASP.NET, ADO.NET, Windows Forms, WPF, and XML. [[Scott Guthrie]] of Microsoft promised that LINQ, WCF, and WF libraries were being added.<ref>{{cite web|title=.NET Framework Library Source Code now available|url=https://weblogs.asp.net/scottgu/net-framework-library-source-code-now-available|website=Scott Guthrie's Blog|publisher=[[Microsoft]]|access-date=February 28, 2015|date=January 16, 2008|first=Scott|last=Guthrie|author-link=Scott Guthrie}}</ref> |
||
⚫ | On October 3, 2007, Microsoft announced that the [[source code]] for .NET Framework 3.5 libraries was to become available under the [[Microsoft Reference Source License]] (Ms-RSL{{efn|name=Ms-RSL-dab|The license was formerly abbreviated Ms-RL, but Ms-RL now refers to the [[Microsoft Reciprocal License]].}}).<ref name="sourcerelease">{{cite web|url=http://weblogs.asp.net/scottgu/releasing-the-source-code-for-the-net-framework-libraries|title=Releasing the Source Code for the NET Framework|website=Scott Guthrie's Blog|publisher=[[Microsoft]]|first=Scott|last=Guthrie|author-link=Scott Guthrie|date=October 3, 2007|access-date=September 15, 2010|archive-url=https://web.archive.org/web/20100907233621/http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx|archive-date=September 7, 2010|url-status=live|df=dmy}}</ref> The source code repository became available online on January 16, 2008, and included BCL, ASP.NET, ADO.NET, Windows Forms, WPF, and XML. [[Scott Guthrie]] of Microsoft promised that LINQ, WCF, and WF libraries were being added.<ref>{{cite web|title=.NET Framework Library Source Code now available|url=https://weblogs.asp.net/scottgu/net-framework-library-source-code-now-available|website=Scott Guthrie's Blog|publisher=[[Microsoft]]|access-date=February 28, 2015|date=January 16, 2008|first=Scott|last=Guthrie|author-link=Scott Guthrie|archive-date=March 18, 2015|archive-url=https://web.archive.org/web/20150318161340/http://weblogs.asp.net/scottgu/net-framework-library-source-code-now-available|url-status=live}}</ref> |
||
The [[.NET Compact Framework]] and [[.NET Micro Framework]] variants of the .NET Framework provided support for other Microsoft platforms such as [[Windows Mobile]], [[Windows CE]] and other resource-constrained embedded devices. [[Silverlight]] provided support for [[web browser]]s via plug-ins. |
The [[.NET Compact Framework]] and [[.NET Micro Framework]] variants of the .NET Framework provided support for other Microsoft platforms such as [[Windows Mobile]], [[Windows CE]] and other resource-constrained embedded devices. [[Silverlight]] provided support for [[web browser]]s via plug-ins. |
||
Line 46: | Line 47: | ||
In November 2014, Microsoft also produced an update to its patent grants, which further extends the scope beyond its prior pledges. Prior projects like [[Mono (software)|Mono]] existed in a legal [[loophole|grey area]] because Microsoft's earlier grants applied only to the technology in "covered specifications", including strictly the 4th editions each of ECMA-334 and ECMA-335. The new patent promise, however, places no ceiling on the specification version, and even extends to any .NET runtime technologies documented on MSDN that have not been formally specified by the ECMA group, if a project chooses to implement them. This allows Mono and other projects to maintain feature parity with modern .NET features that have been introduced since the 4th edition was published without being at risk of patent litigation over the implementation of those features. The new grant does maintain the restriction that any implementation must maintain minimum compliance with the mandatory parts of the CLI specification.<ref name="dotnet-patent-promise">{{cite web|title=Microsoft Patent Promise for .NET Libraries and Runtime Components|website=[[GitHub]]|url=https://github.com/dotnet/corefx/blob/master/PATENTS.TXT|access-date=November 16, 2014|archive-date=February 21, 2021|archive-url=https://web.archive.org/web/20210221070138/https://github.com/dotnet/corefx/blob/master/PATENTS.TXT|url-status=live}}</ref> |
In November 2014, Microsoft also produced an update to its patent grants, which further extends the scope beyond its prior pledges. Prior projects like [[Mono (software)|Mono]] existed in a legal [[loophole|grey area]] because Microsoft's earlier grants applied only to the technology in "covered specifications", including strictly the 4th editions each of ECMA-334 and ECMA-335. The new patent promise, however, places no ceiling on the specification version, and even extends to any .NET runtime technologies documented on MSDN that have not been formally specified by the ECMA group, if a project chooses to implement them. This allows Mono and other projects to maintain feature parity with modern .NET features that have been introduced since the 4th edition was published without being at risk of patent litigation over the implementation of those features. The new grant does maintain the restriction that any implementation must maintain minimum compliance with the mandatory parts of the CLI specification.<ref name="dotnet-patent-promise">{{cite web|title=Microsoft Patent Promise for .NET Libraries and Runtime Components|website=[[GitHub]]|url=https://github.com/dotnet/corefx/blob/master/PATENTS.TXT|access-date=November 16, 2014|archive-date=February 21, 2021|archive-url=https://web.archive.org/web/20210221070138/https://github.com/dotnet/corefx/blob/master/PATENTS.TXT|url-status=live}}</ref> |
||
On March 31, 2016, Microsoft announced at [[Build (developer conference)|Microsoft Build]] that they will completely [[software relicensing|relicense]] Mono under an [[MIT License]] even in scenarios where formerly a commercial license was needed.<ref>{{cite web|last1=Krill|first1=Paul|title=Xamarin's Mono runtime gets a looser license|url=http://www.infoworld.com/article/3050732/microsoft-windows/xamarins-mono-runtime-gets-a-looser-license.html|website=[[InfoWorld]]|publisher=[[IDG]]|date=April 1, 2016}}</ref> Microsoft also supplemented its prior patent promise for Mono, stating that they will not assert any "applicable patents" against parties that are "using, selling, offering for sale, importing, or distributing Mono."<ref name=Ferraira1>{{cite web|url=http://techreport.com/news/29929/xamarin-now-comes-free-with-visual-studio|title=Xamarin now comes free with Visual Studio.|work=The Tech Report|date=March 31, 2016|first=Bruno|last=Ferraira|access-date=April 12, 2016|archive-date=April 2, 2016|archive-url=https://web.archive.org/web/20160402173444/http://techreport.com/news/29929/xamarin-now-comes-free-with-visual-studio|url-status=live}}</ref><ref name="Microsoft_PP_Mono">{{cite web|url=https://github.com/mono/mono/blob/master/PATENTS.TXT|title=Microsoft Patent Promise for Mono|work=Mono on GitHub |
On March 31, 2016, Microsoft announced at [[Build (developer conference)|Microsoft Build]] that they will completely [[software relicensing|relicense]] Mono under an [[MIT License]] even in scenarios where formerly a commercial license was needed.<ref>{{cite web|last1=Krill|first1=Paul|title=Xamarin's Mono runtime gets a looser license|url=http://www.infoworld.com/article/3050732/microsoft-windows/xamarins-mono-runtime-gets-a-looser-license.html|website=[[InfoWorld]]|publisher=[[IDG]]|date=April 1, 2016|access-date=April 13, 2016|archive-date=April 16, 2016|archive-url=https://web.archive.org/web/20160416032759/http://www.infoworld.com/article/3050732/microsoft-windows/xamarins-mono-runtime-gets-a-looser-license.html|url-status=live}}</ref> Microsoft also supplemented its prior patent promise for Mono, stating that they will not assert any "applicable patents" against parties that are "using, selling, offering for sale, importing, or distributing Mono."<ref name=Ferraira1>{{cite web|url=http://techreport.com/news/29929/xamarin-now-comes-free-with-visual-studio|title=Xamarin now comes free with Visual Studio.|work=The Tech Report|date=March 31, 2016|first=Bruno|last=Ferraira|access-date=April 12, 2016|archive-date=April 2, 2016|archive-url=https://web.archive.org/web/20160402173444/http://techreport.com/news/29929/xamarin-now-comes-free-with-visual-studio|url-status=live}}</ref><ref name="Microsoft_PP_Mono">{{cite web|url=https://github.com/mono/mono/blob/master/PATENTS.TXT|title=Microsoft Patent Promise for Mono|work=Mono on GitHub |date=March 28, 2016|archive-url=https://web.archive.org/web/20160416133644/https://github.com/mono/mono/blob/master/PATENTS.TXT|archive-date=April 16, 2016|access-date=April 16, 2016|url-status=live|df=dmy}}</ref> It was announced that the Mono Project was contributed to the .NET Foundation. These developments followed the acquisition of [[Xamarin]], which began in February 2016 and was finished on March 18, 2016.<ref name="Friedman2">{{cite web|url=https://blog.xamarin.com/xamarin-for-all/|title=Xamarin for Everyone|work=Xamarin Blog |first1=Nat |last1=Friedman |date=March 31, 2016|archive-url=https://web.archive.org/web/20160412072728/https://blog.xamarin.com/xamarin-for-all/|archive-date=April 12, 2016|access-date=April 12, 2016}}</ref> |
||
Microsoft's press release highlights that the cross-platform commitment now allows for a fully open-source, modern server-side .NET stack. Microsoft released the source code for WPF, Windows Forms and WinUI on December 4, 2018.<ref name="ms-wpf-winforms-oss">{{cite web|title=Announcing Open Source of WPF, Windows Forms, and WinUI at Microsoft Connect 2018|url=https://blogs.windows.com/buildingapps/2018/12/04/announcing-open-source-of-wpf-windows-forms-and-winui-at-microsoft-connect-2018/|website=Windows Developer Blog|date=December 4, 2018|publisher=Microsoft|access-date=December 24, 2018|archive-url=https://web.archive.org/web/20181215163944/https://blogs.windows.com/buildingapps/2018/12/04/announcing-open-source-of-wpf-windows-forms-and-winui-at-microsoft-connect-2018/|archive-date=December 15, 2018}}</ref> |
Microsoft's press release highlights that the cross-platform commitment now allows for a fully open-source, modern server-side .NET stack. Microsoft released the source code for WPF, Windows Forms and WinUI on December 4, 2018.<ref name="ms-wpf-winforms-oss">{{cite web|title=Announcing Open Source of WPF, Windows Forms, and WinUI at Microsoft Connect 2018|url=https://blogs.windows.com/buildingapps/2018/12/04/announcing-open-source-of-wpf-windows-forms-and-winui-at-microsoft-connect-2018/|website=Windows Developer Blog|date=December 4, 2018|publisher=Microsoft |first1=Kevin |last1=Gallo |access-date=December 24, 2018|archive-url=https://web.archive.org/web/20181215163944/https://blogs.windows.com/buildingapps/2018/12/04/announcing-open-source-of-wpf-windows-forms-and-winui-at-microsoft-connect-2018/|archive-date=December 15, 2018}}</ref> |
||
==Architecture== |
==Architecture== |
||
Line 66: | Line 67: | ||
Compiled CIL code is stored in [[assembly (CLI)|CLI assemblies]]. As mandated by the specification, assemblies are stored in [[Portable Executable]] (PE) file format, common on Windows platform for all ''[[dynamic-link library]]'' (DLL) and ''executable'' [[EXE]] files. Each assembly consists of one or more files, one of which must contain a manifest bearing the [[metadata]] for the assembly. The complete name of an assembly (not to be confused with the file name 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. |
Compiled CIL code is stored in [[assembly (CLI)|CLI assemblies]]. As mandated by the specification, assemblies are stored in [[Portable Executable]] (PE) file format, common on Windows platform for all ''[[dynamic-link library]]'' (DLL) and ''executable'' [[EXE]] files. Each assembly consists of one or more files, one of which must contain a manifest bearing the [[metadata]] for the assembly. The complete name of an assembly (not to be confused with the file name 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. |
||
A private key can also be used by the creator of the assembly for [[strong name|strong naming]]. The public key token determines the real-world identity of the assembly's signer. Only |
A private key can also be used by the creator of the assembly for [[strong name|strong naming]]. The public key token determines the real-world identity of the assembly's signer. Only those knowing their private key (of the double-key cryptography system) can sign assemblies that have the same strong name as a prior version assembly. Strong naming is required to add assemblies to [[Global Assembly Cache]]. |
||
Starting with Visual Studio 2015, .NET Native compilation technology allows for the compilation of .NET code of [[Universal Windows Platform apps]] directly to machine code rather than CIL code, but the app must be written in either C# or Visual Basic.NET.<ref>{{cite web|url=https://docs.microsoft.com/en-us/dotnet/framework/net-native/|title=Compiling Apps with .NET Native|last=rpetrusha|website= |
Starting with Visual Studio 2015, .NET Native compilation technology allows for the compilation of .NET code of [[Universal Windows Platform apps]] directly to machine code rather than CIL code, but the app must be written in either C# or Visual Basic.NET.<ref>{{cite web|url=https://docs.microsoft.com/en-us/dotnet/framework/net-native/|title=Compiling Apps with .NET Native|last=rpetrusha|website=Microsoft Learn|access-date=December 2, 2017|archive-date=December 3, 2017|archive-url=https://web.archive.org/web/20171203082710/https://docs.microsoft.com/en-us/dotnet/framework/net-native/|url-status=live}}</ref> |
||
===Class library=== |
===Class library=== |
||
Line 74: | Line 75: | ||
.NET Framework includes an implementation of the CLI foundational [[Standard Libraries (CLI)|Standard Libraries]]. The .NET Framework Class Library (FCL) is organized in a hierarchy of [[namespace]]s. Most of the built-in [[application programming interface]]s (APIs) are part of either <code>System.*</code> or <code>Microsoft.*</code> namespaces. These class libraries implement many common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation. The class libraries are available for all [[List of CLI languages|CLI compliant languages]]. The FCL implements the CLI [[Base Class Library]] (BCL) and other class libraries—some are specified by CLI and other are Microsoft specific. |
.NET Framework includes an implementation of the CLI foundational [[Standard Libraries (CLI)|Standard Libraries]]. The .NET Framework Class Library (FCL) is organized in a hierarchy of [[namespace]]s. Most of the built-in [[application programming interface]]s (APIs) are part of either <code>System.*</code> or <code>Microsoft.*</code> namespaces. These class libraries implement many common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation. The class libraries are available for all [[List of CLI languages|CLI compliant languages]]. The FCL implements the CLI [[Base Class Library]] (BCL) and other class libraries—some are specified by CLI and other are Microsoft specific. |
||
BCL includes a small subset of the entire class library and is the core set of classes that serve as the basic [[API]] of CLR.<ref name="bcllibs">{{cite web|url=https://msdn.microsoft.com/netframework/aa569603.aspx|title=Base Class |
BCL includes a small subset of the entire class library and is the core set of classes that serve as the basic [[API]] of CLR.<ref name="bcllibs">{{cite web|url=https://msdn.microsoft.com/netframework/aa569603.aspx|title=Base Class Libraries Community |website=Microsoft |url-status=dead |archive-url=https://web.archive.org/web/20090424204812/http://msdn.microsoft.com/en-us/netframework/aa569603.aspx |archive-date=Apr 24, 2009 |access-date=June 1, 2008}}</ref> For .NET Framework most classes considered being part of BCL reside in <code>mscorlib.dll</code>, <code>System.dll</code> and <code>System.Core.dll</code>. BCL classes are available in .NET Framework as well as in CLI's alternative implementations including [[.NET Compact Framework]], [[Microsoft Silverlight]], [[.NET Core]] and [[Mono (software)|Mono]]. |
||
FCL refers to the entire class library that ships with .NET Framework. It includes BCL, an expanded set of libraries, including [[Windows Forms]], [[ASP.NET]], and [[Windows Presentation Foundation]] (WPF), and also extensions to the base class libraries [[ADO.NET]], [[Language Integrated Query]] (LINQ), [[Windows Communication Foundation]] (WCF), and [[Workflow Foundation]] (WF). FCL is much larger in scope than standard libraries for languages like [[C++]], and comparable in scope to [[Java Class Library|standard libraries of Java]]. |
FCL refers to the entire class library that ships with .NET Framework. It includes BCL, an expanded set of libraries, including [[Windows Forms]], [[ASP.NET]], and [[Windows Presentation Foundation]] (WPF), and also extensions to the base class libraries [[ADO.NET]], [[Language Integrated Query]] (LINQ), [[Windows Communication Foundation]] (WCF), and [[Workflow Foundation]] (WF). FCL is much larger in scope than standard libraries for languages like [[C++]], and comparable in scope to [[Java Class Library|standard libraries of Java]]. |
||
With the introduction of alternative CLI's implementations (e.g., Silverlight), Microsoft introduced the concept of Portable Class Libraries (PCL) allowing a consuming library to run on more than one implementation. With the further proliferation of implementations, the PCL approach failed to scale (PCLs are defined intersections of API surface between two or more implementations).<ref name="netstandard">{{cite web|url=https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md|title=.NET Platform Standard|website=[[GitHub]]|access-date=April 23, 2016|archive-date=May 19, 2016|archive-url=https://web.archive.org/web/20160519180849/https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md|url-status= |
With the introduction of alternative CLI's implementations (e.g., Silverlight), Microsoft introduced the concept of Portable Class Libraries (PCL) allowing a consuming library to run on more than one implementation. With the further proliferation of implementations, the PCL approach failed to scale (PCLs are defined intersections of API surface between two or more implementations).<ref name="netstandard">{{cite web|url=https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md|title=.NET Platform Standard|website=[[GitHub]]|access-date=April 23, 2016|archive-date=May 19, 2016|archive-url=https://web.archive.org/web/20160519180849/https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md|url-status=dead }}</ref> As the next evolutionary step of PCL, the .NET Standard Library was created retroactively based on the <code>System.Runtime.dll</code> based APIs found in UWP and Silverlight. New CLI's implementations are encouraged to implement a version of the Standard Library allowing them to run existent third-party libraries with no need of creating new versions of them. The .NET Standard Library allows an independent evolution of the library and app model layers within the .NET architecture.<ref name="appmodels">{{cite web |url=http://www.hanselman.com/blog/AnUpdateOnASPNETCore10RC2.aspx |title=An update on ASP.NET Core 1.0 RC2 |date=April 14, 2016 |website=Scott Hanselman |access-date=April 23, 2016 |archive-date=April 19, 2016 |archive-url=https://web.archive.org/web/20160419194652/http://www.hanselman.com/blog/AnUpdateOnASPNETCore10RC2.aspx |url-status=live }}</ref> |
||
[[NuGet]] is the package manager for all .NET platforms. It is used to retrieve third-party libraries into a .NET project with a global library feed at NuGet.org.<ref>{{cite web|url=https://nuget.org|title=NuGet Gallery – Home|website=nuget.org|access-date=February 21, 2021|archive-date=February 21, 2021|archive-url=https://web.archive.org/web/20210221070142/https://www.nuget.org/|url-status=live}}</ref> Private feeds can be maintained separately, e.g., by a build server or a file system directory. |
[[NuGet]] is the package manager for all .NET platforms. It is used to retrieve third-party libraries into a .NET project with a global library feed at NuGet.org.<ref>{{cite web|url=https://nuget.org|title=NuGet Gallery – Home|website=nuget.org|access-date=February 21, 2021|archive-date=February 21, 2021|archive-url=https://web.archive.org/web/20210221070142/https://www.nuget.org/|url-status=live}}</ref> Private feeds can be maintained separately, e.g., by a build server or a file system directory. |
||
[[File:UML dotnet streams.svg|thumb|UML package diagram of the stream hierarchy in .NET]] |
|||
===C++/CLI=== |
===C++/CLI=== |
||
Line 88: | Line 91: | ||
Assemblies compiled using the C++/CLI compiler are termed mixed-mode assemblies since they contain native and managed code in the same DLL.<ref>[https://msdn.microsoft.com/en-us/library/x0w2664k.aspx Mixed (Native and Managed) Assemblies] {{Webarchive|url=https://web.archive.org/web/20141022111729/http://msdn.microsoft.com/en-us/library/x0w2664k.aspx |date=October 22, 2014 }}, MSDN</ref> Such assemblies are more complex to reverse engineer since .NET [[decompilers]] such as [[.NET Reflector]] reveal only the managed code. |
Assemblies compiled using the C++/CLI compiler are termed mixed-mode assemblies since they contain native and managed code in the same DLL.<ref>[https://msdn.microsoft.com/en-us/library/x0w2664k.aspx Mixed (Native and Managed) Assemblies] {{Webarchive|url=https://web.archive.org/web/20141022111729/http://msdn.microsoft.com/en-us/library/x0w2664k.aspx |date=October 22, 2014 }}, MSDN</ref> Such assemblies are more complex to reverse engineer since .NET [[decompilers]] such as [[.NET Reflector]] reveal only the managed code. |
||
==Design |
==Design principles== |
||
===Interoperability=== |
===Interoperability=== |
||
{{Written like an advertisement|section|date=April 2023}} |
|||
Because computer systems commonly require interaction between newer and older applications, .NET Framework provides means to access functions implemented in newer and older programs that execute outside .NET environment. Access to [[Component Object Model]] (COM) components is provided in <code>System.Runtime.InteropServices</code> and <code>System.EnterpriseServices</code> namespaces of the framework. Access to other functions is via [[Platform Invocation Services]] (P/Invoke). Access to .NET functions from native applications is via the reverse P/Invoke function. |
Because computer systems commonly require interaction between newer and older applications, .NET Framework provides means to access functions implemented in newer and older programs that execute outside .NET environment. Access to [[Component Object Model]] (COM) components is provided in <code>System.Runtime.InteropServices</code> and <code>System.EnterpriseServices</code> namespaces of the framework. Access to other functions is via [[Platform Invocation Services]] (P/Invoke). Access to .NET functions from native applications is via the reverse P/Invoke function. |
||
Interoperability enables you to preserve and take advantage of existing investments in unmanaged code{{efn|Code that runs under the control of the Common Language Runtime (CLR) is called managed code, and code that runs outside the CLR is called unmanaged code.}}. |
|||
===Language independence=== |
===Language independence=== |
||
Line 103: | Line 103: | ||
===Portability=== |
===Portability=== |
||
While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be cross-platform,<ref>{{cite web|url=https://channel9.msdn.com/shows/Going+Deep/Scott-Guthrie-Silverlight-and-the-Cross-Platform-CLR|title=Scott Guthrie: Silverlight and the Cross-Platform CLR|date=April 30, 2007|publisher=[[Channel 9 (discussion forum)|Channel 9]]|access-date=April 16, 2016|archive-url=https://web.archive.org/web/20150522144655/http://channel9.msdn.com/shows/Going+Deep/Scott-Guthrie-Silverlight-and-the-Cross-Platform-CLR|archive-date=May 22, 2015|url-status=live|df=dmy}}</ref> and implementations are available for other operating systems (see [[Microsoft Silverlight|Silverlight]] and [[#Alternative implementations|§ Alternative implementations]]). Microsoft submitted the specifications for CLI (which includes the Base Class Libraries, CTS, and CIL),<ref>{{cite web|url=http://www.ecma-international.org/publications/standards/Ecma-335.htm|title=ECMA 335 – Standard ECMA-335 Common Language Infrastructure (CLI) 4th edition (June 2006)|date=June 1, 2006|access-date=June 1, 2008|publisher=ECMA|archive-url=https://web.archive.org/web/20080614092650/http://www.ecma-international.org/publications/standards/Ecma-335.htm|archive-date=June 14, 2008}}</ref><ref>{{cite web|url=http://standards.iso.org/ittf/PubliclyAvailableStandards/c042927_ISO_IEC_23271_2006(E)_Software.zip|title=ISO/IEC 23271:2006|publisher=Standards |
While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be cross-platform,<ref>{{cite web|url=https://channel9.msdn.com/shows/Going+Deep/Scott-Guthrie-Silverlight-and-the-Cross-Platform-CLR|title=Scott Guthrie: Silverlight and the Cross-Platform CLR|date=April 30, 2007|publisher=[[Channel 9 (discussion forum)|Channel 9]]|access-date=April 16, 2016|archive-url=https://web.archive.org/web/20150522144655/http://channel9.msdn.com/shows/Going+Deep/Scott-Guthrie-Silverlight-and-the-Cross-Platform-CLR|archive-date=May 22, 2015|url-status=live|df=dmy}}</ref> and implementations are available for other operating systems (see [[Microsoft Silverlight|Silverlight]] and [[#Alternative implementations|§ Alternative implementations]]). Microsoft submitted the specifications for CLI (which includes the Base Class Libraries, CTS, and CIL),<ref>{{cite web|url=http://www.ecma-international.org/publications/standards/Ecma-335.htm|title=ECMA 335 – Standard ECMA-335 Common Language Infrastructure (CLI) 4th edition (June 2006)|date=June 1, 2006|access-date=June 1, 2008|publisher=ECMA|archive-url=https://web.archive.org/web/20080614092650/http://www.ecma-international.org/publications/standards/Ecma-335.htm|archive-date=June 14, 2008}}</ref><ref>{{cite web|url=http://standards.iso.org/ittf/PubliclyAvailableStandards/c042927_ISO_IEC_23271_2006(E)_Software.zip|title=ISO/IEC 23271:2006|publisher=ISO Standards |date=September 29, 2006|access-date=April 17, 2012|archive-date=July 1, 2018|archive-url=https://web.archive.org/web/20180701142510/http://standards.iso.org/ittf/PubliclyAvailableStandards/c042927_ISO_IEC_23271_2006%28E%29_Software.zip|url-status=dead }}</ref><ref>{{cite web|url=http://www.ecma-international.org/publications/techreports/E-TR-084.htm|title=Technical Report TR/84 Common Language Infrastructure (CLI) – Information Derived from Partition IV XML File|date=June 1, 2006|publisher=ECMA|access-date=April 16, 2016|archive-url=https://web.archive.org/web/20150307073541/http://www.ecma-international.org/publications/techreports/E-TR-084.htm|archive-date=March 7, 2015|url-status=dead|df=dmy}}</ref> [[C Sharp (programming language)|C#]],<ref name="Ecma-334"/> and C++/CLI<ref>{{cite web|url=http://www.ecma-international.org/publications/standards/Ecma-372.htm|title=Standard ECMA-372 C++/CLI Language Specification|date=December 1, 2005|publisher=ECMA|access-date=January 16, 2008|archive-url=https://web.archive.org/web/20080810165757/http://www.ecma-international.org/publications/standards/Ecma-372.htm|archive-date=August 10, 2008|url-status=dead}}</ref> to both [[Ecma International]] (ECMA) and [[International Organization for Standardization]] (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. |
||
Core cross-platform .NET (formerly .NET Core) is officially available also for many Linux distributions and MacOS.<ref>{{cite web|url=https://learn.microsoft.com/en-us/archive/msdn-magazine/2016/april/net-core-net-goes-cross-platform-with-net-core|title=.NET Goes Cross-Platform with .NET Core|access-date=February 19, 2024|archive-date=February 19, 2024|archive-url=https://web.archive.org/web/20240219220328/https://learn.microsoft.com/en-us/archive/msdn-magazine/2016/april/net-core-net-goes-cross-platform-with-net-core|url-status=live}}</ref> |
|||
===Security=== |
===Security=== |
||
Line 113: | Line 115: | ||
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 a reference to an object exists, which may be either direct, or via a [[graph (data structure)|graph]] of objects, the object is considered to be in use. When no reference to an object exists, and it cannot be reached or used, it becomes garbage, eligible for collection. |
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 a reference to an object exists, which may be either direct, or via a [[graph (data structure)|graph]] of objects, the object is considered to be in use. When no reference to an object exists, and it cannot be reached or used, it becomes garbage, eligible for collection. |
||
.NET Framework includes a [[Garbage collection (computer science)|garbage collector]] (GC) which runs periodically, on a separate [[thread (computing)|thread]] from the application's thread, that enumerates all the unusable objects and reclaims the memory allocated to them. It is a non-deterministic, compacting, [[tracing garbage collection#Naïve mark-and-sweep|mark-and-sweep]] garbage collector. GC runs only when a set 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 [[Nondeterministic algorithm|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, objects defined as local variables or method parameters currently in scope, and objects referred to by CPU registers.<ref name="part1">{{cite web|url=https://msdn.microsoft.com/msdnmag/issues/1100/GCI/|archive-url=https://web.archive.org/web/20070703083608/http://msdn.microsoft.com/msdnmag/issues/1100/GCI/|archive-date=July 3, 2007|title=Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework|access-date=June 1, 2008|url-status=dead|df=mdy-all}}</ref> When GC runs, it pauses the application and then, for each object referred to in the root, it [[recursion|recursively]] enumerates all the objects reachable from the root objects and marks them as reachable. It uses CLI metadata and [[reflection (computer programming)|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.<ref name="part1"/> This is the ''mark'' phase.<ref name="gcnet">{{cite web|url=http://www.csharphelp.com/archives2/archive297.html|title=Garbage collection in .NET|access-date=June 1, 2008|archive-url=https://web.archive.org/web/20080525165023/http://www.csharphelp.com/archives2/archive297.html|archive-date=May 25, 2008|url-status=dead|df=dmy}}</ref> Since the memory held by garbage is of no 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 free space on the managed heap contiguous again.<ref name="part1"/><ref name="gcnet"/> Any reference to an object invalidated by moving the object is updated by GC to reflect the new location.<ref name="gcnet"/> The application is resumed after garbage collection ends. The latest version of .NET framework uses concurrent garbage collection along with user code, making pauses unnoticeable, because it is done in the background.<ref>{{cite web|url=https://blogs.msdn.microsoft.com/dotnet/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client-and-server-apps/|title=The .NET Framework 4.5 includes new garbage collector enhancements for client and server apps|date=July 20, 2012 |
.NET Framework includes a [[Garbage collection (computer science)|garbage collector]] (GC) which runs periodically, on a separate [[thread (computing)|thread]] from the application's thread, that enumerates all the unusable objects and reclaims the memory allocated to them. It is a non-deterministic, compacting, [[tracing garbage collection#Naïve mark-and-sweep|mark-and-sweep]] garbage collector. GC runs only when a set 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 [[Nondeterministic algorithm|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, objects defined as local variables or method parameters currently in scope, and objects referred to by CPU registers.<ref name="part1">{{cite web|url=https://msdn.microsoft.com/msdnmag/issues/1100/GCI/|archive-url=https://web.archive.org/web/20070703083608/http://msdn.microsoft.com/msdnmag/issues/1100/GCI/|archive-date=July 3, 2007|title=Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework|access-date=June 1, 2008|url-status=dead|df=mdy-all}}</ref> When GC runs, it pauses the application and then, for each object referred to in the root, it [[recursion|recursively]] enumerates all the objects reachable from the root objects and marks them as reachable. It uses CLI metadata and [[reflection (computer programming)|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.<ref name="part1"/> This is the ''mark'' phase.<ref name="gcnet">{{cite web|url=http://www.csharphelp.com/archives2/archive297.html|title=Garbage collection in .NET|access-date=June 1, 2008|archive-url=https://web.archive.org/web/20080525165023/http://www.csharphelp.com/archives2/archive297.html|archive-date=May 25, 2008|url-status=dead|df=dmy}}</ref> Since the memory held by garbage is of no 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 free space on the managed heap contiguous again.<ref name="part1"/><ref name="gcnet"/> Any reference to an object invalidated by moving the object is updated by GC to reflect the new location.<ref name="gcnet"/> The application is resumed after garbage collection ends. The latest version of .NET framework uses concurrent garbage collection along with user code, making pauses unnoticeable, because it is done in the background.<ref>{{cite web|url=https://blogs.msdn.microsoft.com/dotnet/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client-and-server-apps/|title=The .NET Framework 4.5 includes new garbage collector enhancements for client and server apps|date=July 20, 2012|access-date=October 2, 2015|archive-date=February 4, 2016|archive-url=https://web.archive.org/web/20160204132819/https://blogs.msdn.microsoft.com/dotnet/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client-and-server-apps/|url-status=live}}</ref> |
||
The garbage collector used by .NET Framework is also ''[[Garbage collection (computer science)#Generational|generational]]''.<ref name=PART2>{{cite web|url=https://msdn.microsoft.com/msdnmag/issues/1200/GCI2/default.aspx|archive-url=https://web.archive.org/web/20070626080134/http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/default.aspx|archive-date=June 26, 2007|title=Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework|access-date=June 1, 2008|url-status=dead|df=mdy-all}}</ref> Objects are assigned a ''generation''. Newly created objects are tagged ''Generation 0''. Objects that survive one garbage collection are tagged ''Generation 1''. Generation 1 objects that survive another collection are ''Generation 2''. The framework uses up to Generation 2 objects.{{r|PART2}} Higher generation objects are garbage collected less often than lower generation objects. This raises the efficiency of garbage collection, as older objects tend to have longer lifetimes than newer objects.{{r|PART2}} By ignoring older objects in most collection runs, fewer checks and compaction operations are needed in total.{{r|PART2}} |
The garbage collector used by .NET Framework is also ''[[Garbage collection (computer science)#Generational|generational]]''.<ref name=PART2>{{cite web|url=https://msdn.microsoft.com/msdnmag/issues/1200/GCI2/default.aspx|archive-url=https://web.archive.org/web/20070626080134/http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/default.aspx|archive-date=June 26, 2007|title=Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework|access-date=June 1, 2008|url-status=dead|df=mdy-all}}</ref> Objects are assigned a ''generation''. Newly created objects are tagged ''Generation 0''. Objects that survive one garbage collection are tagged ''Generation 1''. Generation 1 objects that survive another collection are ''Generation 2''. The framework uses up to Generation 2 objects.{{r|PART2}} Higher generation objects are garbage collected less often than lower generation objects. This raises the efficiency of garbage collection, as older objects tend to have longer lifetimes than newer objects.{{r|PART2}} By ignoring older objects in most collection runs, fewer checks and compaction operations are needed in total.{{r|PART2}} |
||
Line 120: | Line 122: | ||
When an application is first launched, the .NET Framework compiles the [[Common Intermediate Language|CIL code]] into executable code using its [[just-in-time compiler]], and caches the executable program into the .NET Native Image Cache.<ref>{{cite web|url=http://blogs.telerik.com/justteam/posts/13-05-28/understanding-net-just-in-time-compilation|title=Understanding .NET Just-In-Time Compilation|date=May 28, 2013|website=telerik.com|access-date=May 21, 2015|archive-date=June 11, 2013|archive-url=https://web.archive.org/web/20130611052214/http://blogs.telerik.com/justteam/posts/13-05-28/understanding-net-just-in-time-compilation|url-status=live}}</ref><ref name="cache">[https://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.90).aspx Compiling MSIL to Native Code] {{Webarchive|url=https://web.archive.org/web/20150419013531/https://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.90).aspx |date=April 19, 2015 }}, MSDN, Microsoft</ref> Due to caching, the application launches faster for subsequent launches, although the first launch is usually slower. To speed up the first launch, developers may use the [[Native Image Generator]] utility to manually [[Ahead-of-time compilation|ahead-of-time compile]] and cache any .NET application.<ref name="cache"/> |
When an application is first launched, the .NET Framework compiles the [[Common Intermediate Language|CIL code]] into executable code using its [[just-in-time compiler]], and caches the executable program into the .NET Native Image Cache.<ref>{{cite web|url=http://blogs.telerik.com/justteam/posts/13-05-28/understanding-net-just-in-time-compilation|title=Understanding .NET Just-In-Time Compilation|date=May 28, 2013|website=telerik.com|access-date=May 21, 2015|archive-date=June 11, 2013|archive-url=https://web.archive.org/web/20130611052214/http://blogs.telerik.com/justteam/posts/13-05-28/understanding-net-just-in-time-compilation|url-status=live}}</ref><ref name="cache">[https://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.90).aspx Compiling MSIL to Native Code] {{Webarchive|url=https://web.archive.org/web/20150419013531/https://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.90).aspx |date=April 19, 2015 }}, MSDN, Microsoft</ref> Due to caching, the application launches faster for subsequent launches, although the first launch is usually slower. To speed up the first launch, developers may use the [[Native Image Generator]] utility to manually [[Ahead-of-time compilation|ahead-of-time compile]] and cache any .NET application.<ref name="cache"/> |
||
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 work with can become very large, which means it can take a very long time to visit and rearrange all of them."<ref>{{Cite web|url=https://www.red-gate.com/simple-talk/dotnet/net-framework/understanding-garbage-collection-in-net/|title=Understanding Garbage Collection in .NET|date=June 17, 2009}}</ref> |
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 work with can become very large, which means it can take a very long time to visit and rearrange all of them."<ref>{{Cite web|url=https://www.red-gate.com/simple-talk/dotnet/net-framework/understanding-garbage-collection-in-net/|title=Understanding Garbage Collection in .NET|date=June 17, 2009|access-date=November 13, 2019|archive-date=October 10, 2019|archive-url=https://web.archive.org/web/20191010020210/https://www.red-gate.com/simple-talk/dotnet/net-framework/understanding-garbage-collection-in-net/|url-status=live}}</ref> |
||
.NET Framework provides support for calling [[Streaming SIMD Extensions]] (SSE) via [[managed code]] from April 2014 in Visual Studio 2013 Update 2. However, [[Mono (software)|Mono]] has provided support for [[SIMD]] Extensions as of version 2.2 within the {{Not a typo|Mono.Simd}} namespace in 2009.<ref name="Release Notes">{{cite web|url=http://www.mono-project.com/docs/about-mono/releases/2.2.0/|title=Release Notes Mono 2.2 – Mono|website=mono-project.com}}</ref> Mono's lead developer [[Miguel de Icaza]] has expressed hope that this SIMD support will be adopted by CLR's ECMA standard.<ref>{{cite web|url=http://tirania.org/blog/archive/2008/Nov-03.html|title=Mono's SIMD Support: Making Mono safe for Gaming|publisher=Tirania.org|date=November 3, 2008|access-date=April 17, 2012|archive-date=November 4, 2010|archive-url=https://web.archive.org/web/20101104173338/http://tirania.org/blog/archive/2008/Nov-03.html|url-status=live}}</ref> Streaming SIMD Extensions have been available in [[x86]] CPUs since the introduction of the [[Pentium III]]. Some other architectures such as [[ARM architecture|ARM]] and [[MIPS architecture|MIPS]] also have SIMD extensions. In case the CPU lacks support for those extensions, the instructions are simulated in software.<ref>{{Cite web |title=Mono's SIMD Support: Making Mono safe for Gaming |
.NET Framework provides support for calling [[Streaming SIMD Extensions]] (SSE) via [[managed code]] from April 2014 in Visual Studio 2013 Update 2. However, [[Mono (software)|Mono]] has provided support for [[SIMD]] Extensions as of version 2.2 within the {{Not a typo|Mono.Simd}} namespace in 2009.<ref name="Release Notes">{{cite web|url=http://www.mono-project.com/docs/about-mono/releases/2.2.0/|title=Release Notes Mono 2.2 – Mono|website=mono-project.com|access-date=November 22, 2016|archive-date=November 22, 2016|archive-url=https://web.archive.org/web/20161122220434/http://www.mono-project.com/docs/about-mono/releases/2.2.0/|url-status=live}}</ref> Mono's lead developer [[Miguel de Icaza]] has expressed hope that this SIMD support will be adopted by CLR's ECMA standard.<ref>{{cite web|url=http://tirania.org/blog/archive/2008/Nov-03.html|title=Mono's SIMD Support: Making Mono safe for Gaming|publisher=Tirania.org|date=November 3, 2008 |first1=Miguel |last1=de Icaza |access-date=April 17, 2012|archive-date=November 4, 2010|archive-url=https://web.archive.org/web/20101104173338/http://tirania.org/blog/archive/2008/Nov-03.html|url-status=live}}</ref> Streaming SIMD Extensions have been available in [[x86]] CPUs since the introduction of the [[Pentium III]]. Some other architectures such as [[ARM architecture|ARM]] and [[MIPS architecture|MIPS]] also have SIMD extensions. In case the CPU lacks support for those extensions, the instructions are simulated in software.<ref>{{Cite web |title=Mono's SIMD Support: Making Mono safe for Gaming |first1=Miguel |last1=de Icaza |date=3 Nov 2008 |url=https://tirania.org/blog/archive/2008/Nov-03.html |access-date=2022-05-06 |website=tirania.org |archive-date=July 2, 2022 |archive-url=https://web.archive.org/web/20220702211916/https://tirania.org/blog/archive/2008/Nov-03.html |url-status=live }}</ref><ref>{{Cite web |title=SIMD-accelerated types in .NET |url=https://docs.microsoft.com/en-us/dotnet/standard/simd |access-date=2022-05-06 |website=Microsoft Learn |language=en-us |archive-date=May 6, 2022 |archive-url=https://web.archive.org/web/20220506202738/https://docs.microsoft.com/en-us/dotnet/standard/simd |url-status=live }}</ref> |
||
==Alternative implementations== |
==Alternative implementations== |
||
Line 142: | Line 144: | ||
|- |
|- |
||
! scope=row | .NET Framework (redistributable package) |
! scope=row | .NET Framework (redistributable package) |
||
| [[Proprietary software]]<ref>{{cite web|title=Microsoft .NET Framework Redistributable EULA|url=https://msdn.microsoft.com/en-us/library/ms994405.aspx|website=[[MSDN]]|publisher=[[Microsoft]]|access-date=February 28, 2015|archive-date=April 2, 2015|archive-url=https://web.archive.org/web/20150402161923/https://msdn.microsoft.com/en-us/library/ms994405.aspx|url-status=live}}</ref> |
| [[Proprietary software]]<ref>{{cite web|title=Microsoft .NET Framework Redistributable EULA|url=https://msdn.microsoft.com/en-us/library/ms994405.aspx|website=[[MSDN]]|date=September 13, 2006 |publisher=[[Microsoft]]|access-date=February 28, 2015|archive-date=April 2, 2015|archive-url=https://web.archive.org/web/20150402161923/https://msdn.microsoft.com/en-us/library/ms994405.aspx|url-status=live}}</ref> |
||
|- |
|- |
||
! scope=row | Reference [[source code]] of .NET Framework 4.5 and earlier |
! scope=row | Reference [[source code]] of .NET Framework 4.5 and earlier |
||
Line 151: | Line 153: | ||
|- |
|- |
||
! scope=row | [[Mono (software)|Mono]] |
! scope=row | [[Mono (software)|Mono]] |
||
| MIT License<ref name="Friedman2"/> |
|||
| MIT License<ref>{{cite web|title=Xamarin for Everyone|url=https://blog.xamarin.com/xamarin-for-all/|website=Xamarin Blog|publisher=[[Microsoft]]|date=April 17, 2016|access-date=April 12, 2016|archive-date=April 12, 2016|archive-url=https://web.archive.org/web/20160412072728/https://blog.xamarin.com/xamarin-for-all/|url-status=live}}</ref> |
|||
|- |
|- |
||
! scope=row | [[.NET]] (formerly .NET Core)<br /><small>CoreFX, CoreCLR and CLI</small> |
! scope=row | [[.NET]] (formerly .NET Core)<br /><small>CoreFX, CoreCLR and CLI</small> |
Revision as of 22:26, 9 August 2024
Developer(s) | Microsoft |
---|---|
Initial release | February 13, 2002 |
Stable release | 4.8.1
/ August 9, 2022[1] |
Operating system | Windows 98 or later, Windows NT 4.0 or later |
Platform | IA-32, x86-64, and ARM |
Included with | Microsoft Windows |
Successor | .NET |
Type | Software framework |
License | Mixed; see § Licensing |
Website | dotnet |
The .NET Framework (pronounced as "dot net") is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until being superseded by the cross-platform .NET project. It includes a large class library called 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 (in contrast to a hardware environment) named the Common Language Runtime (CLR). The CLR is an application virtual machine that provides services such as security, memory management, and exception handling. As such, computer code written using .NET Framework is called "managed code". FCL and CLR together constitute the .NET Framework.
FCL provides the user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. Programmers produce software by combining their source code with the .NET Framework and other libraries. The framework is intended to be used by most new applications created for the Windows platform. Microsoft also produces an integrated development environment for .NET software called Visual Studio.
.NET Framework began as proprietary software, although the firm worked to standardize the software stack almost immediately, even before its first release. Despite the standardization efforts, developers, mainly those in the free and open-source software communities, expressed their unease with the selected terms and the prospects of any free and open-source implementation, especially regarding software patents. Since then, Microsoft has changed .NET development to more closely follow a contemporary model of a community-developed software project, including issuing an update to its patent promising to address the concerns.[2]
In April 2019, Microsoft released .NET Framework 4.8, the last major version of the framework as a proprietary offering, followed by .NET Framework 4.8.1 in August 2022. Only monthly security and reliability bug fixes to that version have been released since then. No further changes to that version are planned. The .NET Framework will continue to be included with future releases of Windows and continue to receive security updates, with no plans to remove it as of November 2023.[3]
History
Microsoft began developing .NET Framework in the late 1990s, originally under the name of Next Generation Windows Services (NGWS), as part of the .NET strategy. By early 2000, the first beta versions of .NET 1.0 were released.
In August 2000, Microsoft and Intel worked to standardize Common Language Infrastructure (CLI) and C#. By December 2001, both were ratified by ECMA standards.[4][5] International Organization for Standardization (ISO) followed in April 2003. The current version of ISO standards are ISO/IEC 23271:2012 and ISO/IEC 23270:2006.[6][7]
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". The firms agreed to meet these terms, and to make the patents available royalty-free. However, this did not apply to the part of the .NET Framework not covered by ECMA-ISO standards, which included Windows Forms, ADO.NET, and ASP.NET. Patents that Microsoft holds in these areas may have deterred non-Microsoft implementations of the full framework.[8]
Windows Vista is the first client version of Windows that integrated the .NET Framework.
On October 3, 2007, Microsoft announced that the source code for .NET Framework 3.5 libraries was to become available under the Microsoft Reference Source License (Ms-RSL[a]).[9] The source code repository became available online on January 16, 2008, and included BCL, ASP.NET, ADO.NET, Windows Forms, WPF, and XML. Scott Guthrie of Microsoft promised that LINQ, WCF, and WF libraries were being added.[10]
The .NET Compact Framework and .NET Micro Framework variants of the .NET Framework provided support for other Microsoft platforms such as Windows Mobile, Windows CE and other resource-constrained embedded devices. Silverlight provided support for web browsers via plug-ins.
In November 2014, Microsoft also produced an update to its patent grants, which further extends the scope beyond its prior pledges. Prior projects like Mono existed in a legal grey area because Microsoft's earlier grants applied only to the technology in "covered specifications", including strictly the 4th editions each of ECMA-334 and ECMA-335. The new patent promise, however, places no ceiling on the specification version, and even extends to any .NET runtime technologies documented on MSDN that have not been formally specified by the ECMA group, if a project chooses to implement them. This allows Mono and other projects to maintain feature parity with modern .NET features that have been introduced since the 4th edition was published without being at risk of patent litigation over the implementation of those features. The new grant does maintain the restriction that any implementation must maintain minimum compliance with the mandatory parts of the CLI specification.[11]
On March 31, 2016, Microsoft announced at Microsoft Build that they will completely relicense Mono under an MIT License even in scenarios where formerly a commercial license was needed.[12] Microsoft also supplemented its prior patent promise for Mono, stating that they will not assert any "applicable patents" against parties that are "using, selling, offering for sale, importing, or distributing Mono."[13][14] It was announced that the Mono Project was contributed to the .NET Foundation. These developments followed the acquisition of Xamarin, which began in February 2016 and was finished on March 18, 2016.[15]
Microsoft's press release highlights that the cross-platform commitment now allows for a fully open-source, modern server-side .NET stack. Microsoft released the source code for WPF, Windows Forms and WinUI on December 4, 2018.[16]
Architecture
Common Language Infrastructure
Common Language Infrastructure (CLI) provides a language-neutral platform for application development and execution. By implementing the core aspects of .NET Framework within the scope of CLI, these functions will not be tied to one language but will be available across the many languages supported by the framework.
Common Language Runtime
.NET Framework includes the Common Language Runtime (CLR). It serves as the execution engine of .NET Framework and offers many services such as memory management, type safety, exception handling, garbage collection, security and thread management. All programs written for .NET Framework are executed by the CLR.
Programs written for .NET Framework are compiled into Common Intermediate Language code (CIL), as opposed to being directly compiled into machine code. During execution, an architecture-specific just-in-time compiler (JIT) turns the CIL code into machine code.
Assemblies
Compiled CIL code is stored in CLI assemblies. As mandated by the specification, assemblies are stored in Portable Executable (PE) file format, common on Windows platform for all dynamic-link library (DLL) and executable EXE files. Each assembly consists of one or more files, one of which must contain a manifest bearing the metadata for the assembly. The complete name of an assembly (not to be confused with the file name 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.
A private key can also be used by the creator of the assembly for strong naming. The public key token determines the real-world identity of the assembly's signer. Only those knowing their private key (of the double-key cryptography system) can sign assemblies that have the same strong name as a prior version assembly. Strong naming is required to add assemblies to Global Assembly Cache.
Starting with Visual Studio 2015, .NET Native compilation technology allows for the compilation of .NET code of Universal Windows Platform apps directly to machine code rather than CIL code, but the app must be written in either C# or Visual Basic.NET.[17]
Class library
.NET Framework includes an implementation of the CLI foundational Standard Libraries. The .NET Framework Class Library (FCL) is organized in a hierarchy of namespaces. Most of the built-in application programming interfaces (APIs) are part of either System.*
or Microsoft.*
namespaces. These class libraries implement many common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation. The class libraries are available for all CLI compliant languages. The FCL implements the CLI Base Class Library (BCL) and other class libraries—some are specified by CLI and other are Microsoft specific.
BCL includes a small subset of the entire class library and is the core set of classes that serve as the basic API of CLR.[18] For .NET Framework most classes considered being part of BCL reside in mscorlib.dll
, System.dll
and System.Core.dll
. BCL classes are available in .NET Framework as well as in CLI's alternative implementations including .NET Compact Framework, Microsoft Silverlight, .NET Core and Mono.
FCL refers to the entire class library that ships with .NET Framework. It includes BCL, an expanded set of libraries, including Windows Forms, ASP.NET, and Windows Presentation Foundation (WPF), and also extensions to the base class libraries ADO.NET, Language Integrated Query (LINQ), Windows Communication Foundation (WCF), and Workflow Foundation (WF). FCL is much larger in scope than standard libraries for languages like C++, and comparable in scope to standard libraries of Java.
With the introduction of alternative CLI's implementations (e.g., Silverlight), Microsoft introduced the concept of Portable Class Libraries (PCL) allowing a consuming library to run on more than one implementation. With the further proliferation of implementations, the PCL approach failed to scale (PCLs are defined intersections of API surface between two or more implementations).[19] As the next evolutionary step of PCL, the .NET Standard Library was created retroactively based on the System.Runtime.dll
based APIs found in UWP and Silverlight. New CLI's implementations are encouraged to implement a version of the Standard Library allowing them to run existent third-party libraries with no need of creating new versions of them. The .NET Standard Library allows an independent evolution of the library and app model layers within the .NET architecture.[20]
NuGet is the package manager for all .NET platforms. It is used to retrieve third-party libraries into a .NET project with a global library feed at NuGet.org.[21] Private feeds can be maintained separately, e.g., by a build server or a file system directory.
C++/CLI
Microsoft introduced C++/CLI in Visual Studio 2005, which is a language and means of compiling Visual C++ programs to run within the .NET Framework. Some parts of the C++ program still run within an unmanaged Visual C++ Runtime, while specially modified parts are translated into CIL code and run with the .NET Framework's CLR.
Assemblies compiled using the C++/CLI compiler are termed mixed-mode assemblies since they contain native and managed code in the same DLL.[22] Such assemblies are more complex to reverse engineer since .NET decompilers such as .NET Reflector reveal only the managed code.
Design principles
Interoperability
Because computer systems commonly require interaction between newer and older applications, .NET Framework provides means to access functions implemented in newer and older programs that execute outside .NET environment. Access to Component Object Model (COM) components is provided in System.Runtime.InteropServices
and System.EnterpriseServices
namespaces of the framework. Access to other functions is via Platform Invocation Services (P/Invoke). Access to .NET functions from native applications is via the reverse P/Invoke function.
Language independence
.NET Framework introduces a Common Type System (CTS) that defines all possible data types and programming constructs supported by CLR and how they may or may not interact conforming to CLI specifications. Because of this feature, .NET Framework supports the exchange of types and object instances between libraries and applications written using any conforming CLI language.
Type safety
CTS and the CLR used in .NET Framework also enforce type safety. This prevents ill-defined casts, wrong method invocations, and memory size issues when accessing an object. This also makes most CLI languages statically typed (with or without type inference). However, starting with .NET Framework 4.0, the Dynamic Language Runtime extended the CLR, allowing dynamically typed languages to be implemented atop the CLI.
Portability
While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be cross-platform,[23] and implementations are available for other operating systems (see Silverlight and § Alternative implementations). Microsoft submitted the specifications for CLI (which includes the Base Class Libraries, CTS, and CIL),[24][25][26] C#,[5] and C++/CLI[27] to both Ecma International (ECMA) and International Organization for Standardization (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.
Core cross-platform .NET (formerly .NET Core) is officially available also for many Linux distributions and MacOS.[28]
Security
.NET Framework 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 Internet). CAS uses evidence to determine the permissions granted to the code. When calling code demands that it be granted a specific permission, CLR performs a call stack walk checking every assembly of each method in the call stack for the required permission; if any assembly is not granted the permission, it will throw a security exception.
Managed CIL bytecode is easier to reverse-engineer than native code, unless obfuscated.[29] .NET decompiler programs enable developers with no reverse-engineering skills to view the source code behind unobfuscated .NET assemblies. In contrast, apps compiled to native machine code are much harder to reverse-engineer, and source code is almost never produced successfully, mainly because of compiler optimizations and lack of reflection.[30] This creates concerns in the business community over the 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.[b] Third-party obfuscation tools are also available from vendors such as VMware, V.i. Labs, Turbo, and Red Gate Software. Method-level encryption tools for .NET code are available from vendors such as SafeNet.
Memory management
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 a reference to an object exists, which may be either direct, or via a graph of objects, the object is considered to be in use. When no reference to an object exists, and it cannot be reached or used, it becomes garbage, eligible for collection.
.NET Framework includes a garbage collector (GC) 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. It is a non-deterministic, compacting, mark-and-sweep garbage collector. GC runs only when a set 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, objects defined as local variables or method parameters currently in scope, and objects referred to by CPU registers.[31] When GC runs, it pauses the application and then, 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.[31] This is the mark phase.[32] Since the memory held by garbage is of no 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 free space on the managed heap contiguous again.[31][32] Any reference to an object invalidated by moving the object is updated by GC to reflect the new location.[32] The application is resumed after garbage collection ends. The latest version of .NET framework uses concurrent garbage collection along with user code, making pauses unnoticeable, because it is done in the background.[33]
The garbage collector used by .NET Framework is also generational.[34] Objects are assigned a generation. Newly created objects are tagged Generation 0. Objects that survive one garbage collection are tagged Generation 1. Generation 1 objects that survive another collection are Generation 2. The framework uses up to Generation 2 objects.[34] Higher generation objects are garbage collected less often than lower generation objects. This raises the efficiency of garbage collection, as older objects tend to have longer lifetimes than newer objects.[34] By ignoring older objects in most collection runs, fewer checks and compaction operations are needed in total.[34]
Performance
When an application is first launched, the .NET Framework compiles the CIL code into executable code using its just-in-time compiler, and caches the executable program into the .NET Native Image Cache.[35][36] Due to caching, the application launches faster for subsequent launches, although the first launch is usually slower. To speed up the first launch, developers may use the Native Image Generator utility to manually ahead-of-time compile and cache any .NET application.[36]
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 work with can become very large, which means it can take a very long time to visit and rearrange all of them."[37]
.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 in 2009.[38] Mono's lead developer Miguel de Icaza has expressed hope that this SIMD support will be adopted by CLR's ECMA standard.[39] 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.[40][41]
Alternative implementations
.NET Framework was the predominant implementation of CLI, until the release of .NET. 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."[42] It is harder to develop alternatives to FCL, which is not described by an open standard and may be subject to copyright restrictions. Also, parts of FCL have Windows-specific functions 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,[43] 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 WPF, and additional libraries specific to embedded applications.
- Mono is an implementation of CLI and FCL, and provides added functions. It is licensed as free software under the MIT License. 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, parts of FCL, and a C# compiler. It supports a variety of CPUs and operating systems. The project was discontinued, with the last stable release in 2009.
- Microsoft Shared Source Common Language Infrastructure is a non-free implementation of CLR. However, the last version runs on Windows XP SP2 only, and has not been updated since 2006. Thus, it does not contain all features of version 2.0 of .NET Framework.
- CrossNet[44] is an implementation of CLI and parts of FCL. It is free software using an open source MIT License.
Licensing
Microsoft managed code frameworks and their components are licensed as follows:
Component | License |
---|---|
.NET Framework (redistributable package) | Proprietary software[45] |
Reference source code of .NET Framework 4.5 and earlier | Microsoft Reference License (Ms-RSL[a])[9][46] |
Reference source code of .NET Framework 4.6 | MIT License[47] |
Mono | MIT License[15] |
.NET (formerly .NET Core) CoreFX, CoreCLR and CLI |
MIT License[48] |
.NET Micro Framework | Apache License 2.0[49] |
.NET Compiler Platform (codename "Roslyn") | MIT License[50] |
ASP.NET MVC, Web API and Web Pages (Razor) | Apache License 2.0[51] |
ASP.NET Core | Apache License 2.0[52] |
ASP.NET Ajax Control Toolkit | BSD License[53] |
ASP.NET SignalR | Apache License 2.0[54] |
Entity Framework | Apache License 2.0[55] |
NuGet | Apache License 2.0[56] |
See also
- Microsoft Foundation Class Library (MFC), an object-oriented abstraction used to ease Windows-based application programming prior to .NET Framework
- .NET (formerly .NET Core)
- List of CLI languages
- Standard Libraries (CLI), the .NET standard libraries
- Base Class Library (BCL)
Notes
- ^ a b The license was formerly abbreviated Ms-RL, but Ms-RL now refers to the Microsoft Reciprocal License.
- ^ Dotfuscator Community Edition 4.0
References
- ^ "Download .NET Framework 4.8 Offline Installer". Microsoft. Archived from the original on August 15, 2019. Retrieved August 15, 2019.
- ^ Ibanez, Luis (November 19, 2014). "Microsoft gets on board with open source". Opensource.com. Archived from the original on January 2, 2020. Retrieved January 2, 2020.
- ^ gewarren. ".NET Framework & Windows OS versions". Microsoft Learn. Archived from the original on September 3, 2022. Retrieved November 21, 2020.
- ^ "Standard ECMA-335: Common Language Infrastructure (CLI)" (6 ed.). ECMA. June 2012. Archived from the original on June 29, 2013. Retrieved August 31, 2005.
- ^ a b "Standard ECMA-334: C# Language Specification" (4 ed.). ECMA. June 2006. Archived from the original on October 31, 2010. Retrieved August 31, 2005.
- ^ "ISO/IEC 23271:2012 Information technology – Common Language Infrastructure" (3 ed.). International Organization for Standardization. February 13, 2012. Archived from the original on March 17, 2012. Retrieved March 17, 2012.
- ^ "ISO/IEC 23270:2006 – Information technology – Programming languages – C#" (2 ed.). International Organization for Standardization. January 26, 2012. Archived from the original on December 6, 2010. Retrieved April 1, 2008.
- ^ Smith, Brett (16 July 2009). "Microsoft's Empty Promise". Free Software Foundation. Archived from the original on August 19, 2009. Retrieved August 3, 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
- ^ a b Guthrie, Scott (3 October 2007). "Releasing the Source Code for the NET Framework". Scott Guthrie's Blog. Microsoft. Archived from the original on September 7, 2010. Retrieved September 15, 2010.
- ^ Guthrie, Scott (January 16, 2008). ".NET Framework Library Source Code now available". Scott Guthrie's Blog. Microsoft. Archived from the original on March 18, 2015. Retrieved February 28, 2015.
- ^ "Microsoft Patent Promise for .NET Libraries and Runtime Components". GitHub. Archived from the original on February 21, 2021. Retrieved November 16, 2014.
- ^ Krill, Paul (April 1, 2016). "Xamarin's Mono runtime gets a looser license". InfoWorld. IDG. Archived from the original on April 16, 2016. Retrieved April 13, 2016.
- ^ Ferraira, Bruno (March 31, 2016). "Xamarin now comes free with Visual Studio". The Tech Report. Archived from the original on April 2, 2016. Retrieved April 12, 2016.
- ^ "Microsoft Patent Promise for Mono". Mono on GitHub. 28 March 2016. Archived from the original on April 16, 2016. Retrieved April 16, 2016.
- ^ a b Friedman, Nat (March 31, 2016). "Xamarin for Everyone". Xamarin Blog. Archived from the original on April 12, 2016. Retrieved April 12, 2016.
- ^ Gallo, Kevin (December 4, 2018). "Announcing Open Source of WPF, Windows Forms, and WinUI at Microsoft Connect 2018". Windows Developer Blog. Microsoft. Archived from the original on December 15, 2018. Retrieved December 24, 2018.
- ^ rpetrusha. "Compiling Apps with .NET Native". Microsoft Learn. Archived from the original on December 3, 2017. Retrieved December 2, 2017.
- ^ "Base Class Libraries Community". Microsoft. Archived from the original on April 24, 2009. Retrieved June 1, 2008.
- ^ ".NET Platform Standard". GitHub. Archived from the original on May 19, 2016. Retrieved April 23, 2016.
- ^ "An update on ASP.NET Core 1.0 RC2". Scott Hanselman. April 14, 2016. Archived from the original on April 19, 2016. Retrieved April 23, 2016.
- ^ "NuGet Gallery – Home". nuget.org. Archived from the original on February 21, 2021. Retrieved February 21, 2021.
- ^ Mixed (Native and Managed) Assemblies Archived October 22, 2014, at the Wayback Machine, MSDN
- ^ "Scott Guthrie: Silverlight and the Cross-Platform CLR". Channel 9. 30 April 2007. Archived from the original on May 22, 2015. Retrieved April 16, 2016.
- ^ "ECMA 335 – Standard ECMA-335 Common Language Infrastructure (CLI) 4th edition (June 2006)". ECMA. June 1, 2006. Archived from the original on June 14, 2008. Retrieved June 1, 2008.
- ^ "ISO/IEC 23271:2006". ISO Standards. September 29, 2006. Archived from the original on July 1, 2018. Retrieved April 17, 2012.
- ^ "Technical Report TR/84 Common Language Infrastructure (CLI) – Information Derived from Partition IV XML File". ECMA. 1 June 2006. Archived from the original on March 7, 2015. Retrieved April 16, 2016.
- ^ "Standard ECMA-372 C++/CLI Language Specification". ECMA. December 1, 2005. Archived from the original on August 10, 2008. Retrieved January 16, 2008.
- ^ ".NET Goes Cross-Platform with .NET Core". Archived from the original on February 19, 2024. Retrieved February 19, 2024.
- ^ Gartner, Inc. as reported in "Hype Cycle for Cyberthreats, 2006", September 2006, Neil MacDonald; Amrit Williams, et al.
- ^ Cifuentes, Cristina (July 1994). "6: Control Flow Analysis" (PDF). Reverse Compilation Techniques (Thesis). Queensland University of Technology. Archived from the original (PDF) on 22 November 2016.
- ^ a b c "Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework". Archived from the original on July 3, 2007. Retrieved June 1, 2008.
- ^ a b c "Garbage collection in .NET". Archived from the original on May 25, 2008. Retrieved June 1, 2008.
- ^ "The .NET Framework 4.5 includes new garbage collector enhancements for client and server apps". July 20, 2012. Archived from the original on February 4, 2016. Retrieved October 2, 2015.
- ^ a b c d "Garbage Collection—Part 2: Automatic Memory Management in the Microsoft .NET Framework". Archived from the original on June 26, 2007. Retrieved June 1, 2008.
- ^ "Understanding .NET Just-In-Time Compilation". telerik.com. May 28, 2013. Archived from the original on June 11, 2013. Retrieved May 21, 2015.
- ^ a b Compiling MSIL to Native Code Archived April 19, 2015, at the Wayback Machine, MSDN, Microsoft
- ^ "Understanding Garbage Collection in .NET". June 17, 2009. Archived from the original on October 10, 2019. Retrieved November 13, 2019.
- ^ "Release Notes Mono 2.2 – Mono". mono-project.com. Archived from the original on November 22, 2016. Retrieved November 22, 2016.
- ^ de Icaza, Miguel (November 3, 2008). "Mono's SIMD Support: Making Mono safe for Gaming". Tirania.org. Archived from the original on November 4, 2010. Retrieved April 17, 2012.
- ^ de Icaza, Miguel (November 3, 2008). "Mono's SIMD Support: Making Mono safe for Gaming". tirania.org. Archived from the original on July 2, 2022. Retrieved May 6, 2022.
- ^ "SIMD-accelerated types in .NET". Microsoft Learn. Archived from the original on May 6, 2022. Retrieved May 6, 2022.
- ^ ISO 9001:2008, Foreword
- ^ Fairbairn, Christopher (April 1, 2008). "Using VB.NET with the .NET Micro Framework «/dev/mobile". /dev/mobile. Archived from the original on February 27, 2018. Retrieved April 17, 2012.
- ^ "CrossNet". Codeplex.com. Archived from the original on January 25, 2010. Retrieved April 17, 2012.
- ^ "Microsoft .NET Framework Redistributable EULA". MSDN. Microsoft. September 13, 2006. Archived from the original on April 2, 2015. Retrieved February 28, 2015.
- ^ Bray, Brandon (August 15, 2012). "Announcing the release of .NET Framework 4.5 RTM – Product and Source Code". .NET Framework Blog. Microsoft. Archived from the original on October 4, 2016. Retrieved August 18, 2016.
- ^ "Announcing .NET 2015 Preview: A New Era for .NET". .NET Framework Blog. Microsoft. November 12, 2014. Archived from the original on August 19, 2016. Retrieved August 18, 2016.
- ^ ".NET Core 5". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.
- ^ ".NET Micro Framework". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.
- ^ "Roslyn License". GitHub. .NET Foundation. February 5, 2020. Archived from the original on March 24, 2018. Retrieved April 14, 2018.
- ^ "ASP.NET MVC, Web API and Web Pages (Razor)". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.
- ^ "ASP.NET Core License". GitHub. .NET Foundation. July 5, 2017. Archived from the original on February 21, 2021. Retrieved April 14, 2018.
- ^ "ASP.NET Ajax Control Toolkit". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.
- ^ "ASP.NET SignalR". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.
- ^ "Entity Framework". dotnetfoundation.org. .NET Foundation. Archived from the original on 18 April 2016. Retrieved 16 April 2016.
- ^ "NuGet". dotnetfoundation.org. .NET Foundation. Archived from the original on 17 February 2015. Retrieved 17 February 2015.