If you're using Windows 10 1507 or 1511 and you want to install the.NET Framework 4.8, you first need to upgrade to a later Windows 10 version.NET Framework 4.6.2. The.NET Framework 4.6.2 is the latest supported.NET Framework version on Windows 10 1507 and 1511. The.NET Framework 4.6.2 supports apps built for the.NET Framework 4.0 through.
Today, we are announcing the release of the .NET Framework 4.7.1. Itâs included in the Windows 10 Fall Creators Update. .NET Framework 4.7.1 is also available on Windows 7+ and Windows Server 2008 R2+. Weâve added support for targeting the .NET Framework 4.7.1 in Visual Studio 2017 15.5.
The .NET Framework 4.7.1 includes improvements in several areas:
You can download the .NET Framework 4.7.1
For building applications targeting .NET 4.7.1 download the Developer Pack. You can see the complete list of improvements in the .NET Framework 4.7.1 release notes. .NET Framework 4.7.1 reference sources are available on the GitHub .NET Reference source read-only repository. .NET Framework 4.7.1 will be available on Windows Update in the near future. Docker images will be made available for this release and we will update this post when available.
Supported Windows Versions
The .NET Framework 4.7.1 is supported on the following Windows versions:
The .NET Framework 4.7.1 is supported on the following Windows Server versions:
BCL â .NET Standard 2.0 Support
.NET Framework 4.7.1 has built-in support for .NET Standard 2.0. .NET Framework 4.7.1 adds about 200 missing APIs that were part of .NET Standard 2.0 but not actually implemented by .NET Framework 4.6.1, 4.6.2 or 4.7. You can refer to details on .NET Standard on .NET Standard Microsoft docs.
Applications that target .NET Framework 4.6.1 through 4.7 must deploy additional .NET Standard 2.0 support files in order to consume .NET Standard 2.0 libraries. This situation occurred because the .NET Standard 2.0 spec was finalized after .NET Framework 4.6.1 was released. .NET Framework 4.7.1 is the first .NET Framework release after .NET Standard 2.0, enabling us to provide comprehensive .NET Standard 2.0 support.
Experience in .NET Framework 4.6.1 through 4.7
Experience in .NET Framework 4.7.1
Runtime â GC Performance Improvements
.NET Framework 4.7.1 brings in changes in Garbage Collection (GC) to improve the allocation performance, especially for Large Object Heap (LOH) allocations. This is due to an architectural change to split the heapâs allocation lock into 2, for Small Object Heap (SOH) and LOH. Applications that make a lot of LOH allocations, should see a reduction in allocation lock contention, and see better performance. These improvements allow LOH allocations while Background GC (BGC) is sweeping SOH. Usually the LOH allocator waits for the whole duration of the BGC sweep process before it can satisfy requests to allocate memory. This can hinder performance. You can observe this problem in PerfViewâs GCStats where there is an âLOH allocation pause (due to background GC) > 200 msec Eventsâ table. The pause reason is âWaiting for BGC to thread free listsâ. This feature should help mitigate this problem.
ASP.NET Forms Authentication Credentials
ASP.NET has always allowed developers to store user credentials with hashed passwords in configuration files. Previously, the available hash algorithms for this feature were MD5 or SHA-1. Now new secure SHA-2 hash options like SHA-256, SHA-384 and SHA-512 are added in .NET Framework 4.7.1. SHA-1 is still the default to preserve compatibility.
Refer to the following sample to leverage this new feature.
SHA-2 support for Message.HashAlgorithm
In previous versions, if application code specified a System.Messaging HashAlgorithm value, it was limited to MD5 and SHA-1. With .NET Framework 4.7.1, there is support for HashAlgorithm values for SHA-256, SHA-384, and SHA-512 added to System.Messaging Message.HashAlgorithm. The actual usage of these values is in MSMQ as MSMQ makes the âdefaultâ decision and these values are simply passed down to MSMQ. System.Messaging does not do any hashing with these values. Following snippet illustrates how you can enable hashing on a queue and create a message with these new values.
Configuration builders
Configuration builders allow developers to inject and build configuration for applications at runtime, allowing configuration data to be pulled from sources beyond the traditional .config file. In previous versions of the .NET Framework, configuration has been static. Applications only draw configuration data from a limited chain of .config files. With Configuration Builders, applications can apply a custom-defined set of builders to any section of config. These builders are free to modify the configuration data contained in the given config section, or build it entirely from scratch â possibly drawing new data from new sources that are not static files.
To use the Configuration Builders feature, developers simply need to declare builders in config, then apply them to configuration sections with the ConfigBuilders tag.
To implement custom Configuration Builder, developers can inherit from the System.Configuration.ConfigurationBuilder base class.
Here are some code samples that will enable you to declare, use and apply configuration builders.
ASP.NET Execution Step Feature
ASP.NET processes requests in its predefined pipeline which includes 23 events. ASP.NET executes each event handler as an execution step. With this new ExecutionStepInvoker feature, developers will be able to run this execution step inside their code.
Today ASP.NET canât flow the execution context due to switching between native threads and managed threads. ASP.NET selectively flows only the HttpContext which may not be sufficient for ambient context scenarios. With this feature we enable modules to restore ambient data. The ExecutionStepInvoker is intended for libraries that care about the execution flow of the application (tracing, profiling, diagnostics, transactions, etc.).
We have added a new API to enable this: HttpApplication.OnExecuteRequestStep(Action<HttpContextBase, Action> callback)
Check the following sample to leverage this new feature.
ASP.NET HttpCookie parsing
It can be challenging parsing HttpCookie Set-Cookie/Cookie headers to read and write cookie properties from HTTP Headers. Now, we have provided support for a new API that allows for a standardized way to create an HttpCookie object from a string and accurately capture properties of the cookie like expiration date, path, the secure indicator. Furthermore, it assigns cookie value(s) appropriately. This new ASP.NET API for parsing HttpCookie from Set-Cookie/Cookie headers reads as follows: static bool HttpCookie.TryParse(string s, out HttpCookie result)
The following sample illustrates the usage of this new API. Compiler â ValueTuple is Serializable
The System.ValueTuple types in .NET Framework 4.7.1 are now marked as Serializable, which allows binary serialization as shown in the example below. Since the syntax for C# 7.0 and VB 15.5 tuple types, for example, (int, string) relies on System.ValueTuple, this should make migrating from System.Tuple to using the new tuple syntax easier.
Compiler â Support for ReadOnlyReferences
.NET Framework 4.7.1 adds initial support for the ReadOnlyReferences C# 7.2 language feature, which is coming in a future Visual Studio 2017 Update. .NET Framework 4.7.1 introduces the IsReadOnlyAttribute for ReadOnlyReferences feature. This attribute will be used by the compiler to mark members that have readonly-ref return types or parameters. If the compiler is running against an older .NET Framework version, it will generate this attribute and embed itâs definition in the compiled assembly. The following example illustrates C# 7.2 code that can make use of this attribute.
Compiler â Support for Runtime Feature Detection
This new API provides a way to detect whether a particular runtime supports a certain feature or not. At compile time the API provides a way to do that statically through reflection. Whenever the compiler needs to check for runtime support, it would look for the corresponding well-known enum member, for instance, System.Runtime.CompilerServices.RuntimeCapabilities.SupportsDefaultImplementation. If the member exists, then the feature check is successful or the feature is supported. The value for that enum member is ignored.
At runtime the check for feature support is done by calling a static method. This is enabled by the addition of the framework type RuntimeFeature. Tools can query it by calling the static method bool IsSupported(string) to check whether the feature is supported or not, by passing in the string name for a given feature. For example, RuntimeFeature.IsSupported(âFixedGenericAttributesâ).
Following example illustrates C# 7.2 code that can make use of this attribute. Runtime â Support for Portable PDBs
This feature adds support for Portable PDBs in the .NET Framework. Libraries that generate code at runtime, like C# Scripting, would benefit from being able to detect whether the runtime supports Portable PDBs or not. This is because they could emit Portable PDBs instead of Windows PDBs. Emitting Portable PDBs has performance benefits; it is faster and has much smaller memory footprint. In absence of this new API the library would need to resort to hard-coding build numbers of the mscorlib or conservatively assume that .NET Framework doesnât support Portable PDBs. In addition RuntimeFeature.IsSupported method would be changed to return true if âPortablePdbâ is passed to it. Following sample illustrates how this can be passed.
Accessibility improvements
.NET Framework 4.7.1 brings in a lot of accessibility improvements across different libraries to align with the broad Microsoft product accessibility goals.
Enabling the Accessibility Improvements
In order for the application to benefit from these changes, it needs to run on the .NET Framework 4.7.1 or later and configured in one of the following ways:
Applications that target the .NET Framework 4.7.1 or later and want to preserve the legacy accessibility behavior can opt in to the use of legacy accessibility features by explicitly setting this AppContext switch to âtrueâ. Detailed information on all the Accessibility changes are provided in the .NET Framework 4.7.1 Application Compatibility documentation.
Windows Forms Accessibility improvements
Windows Forms accessibility changes are in the following areas:
High Contrast Improvements
Various controls in WinForms are now improved in the way they render under the various HighContrast modes available in the Operating System (OS). Windows 10 has changed the values for some high contrast system colors and Windows Forms is based on the Windows 10 Win32 framework. For the best experience, run on the latest version of Windows and opt in to the latest OS changes by adding an app.manifest file in a test application and un-comment the Windows 10 supportedOS line so that it looks the following example:
<!â Windows 10 â>
<supportedOS Id=â{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}â />
Some examples of High Contrast changes are as follows:
Before:
After:
Improved Narrator Support
You can observe the following accessibility improvements in the Narrator area after you opt-in to the Accessibility improvements in .NET Framework 4.7.1.
Microsoft Net Framework 4.7.2 Download
UI Accessibility Patterns
Developers of accessibility technology tools will now be able to leverage common UI Accessibility patterns and properties for several WinForms controls. These improvements include:
WPF Accessibility improvements
Accessibility improvements in WPF are in the following areas:
UIAutomation LiveRegion Support
Screen readers such as Narrator help people read the UI contents of an application, usually by text-to-speech output of the UI content thatâs currently focused. However, if a UI element changes somewhere in the screen and it is not being focused at that point in time, the user may not be notified, and so they may be missing important information.
LiveRegions are meant to solve this problem. A developer can use them to inform the screen reader, or any other UIAutomation client, that an important change has been made to a UI element. The screen reader can then make decisions of its own as to how and when to inform the user of this change. The LiveSetting property also informs the screen reader of the importance of the UI change to the user.
LiveSettingProperty and LiveRegionChangedEvent have been added to System.Windows.Automation.AutomationElementIdentifiers, settable via XAML.
Microsoft Net Framework 4 7
A new DependencyProperty is now registered for âLiveSettingâ under System.Windows.Automation.AutomationProperties, as well as Set and Get methods. System.Windows.Automation.Peers.AutomationPeer now has a new method GetLiveSettingCore, which can be overridden to provide a LiveSetting value.
A new enumeration for the possible values of LiveSetting has been added to System.Windows.Automation.
How to make a LiveRegion?
You can set the AutomationProperties.LiveSetting property on the element of interest to make it a âLiveRegionâ as shown in the following sample.
Announcing an important UI change
When the data changes on your LiveRegion, and you feel the need to inform a screen reader about that change, you need to explicitly raise an event as illustrated by the following sample.
Screen reader
You can observe the following accessibility improvements in the screen reader area after you opt-in to the Accessibility improvements in .NET Framework 4.7.1.
High Contrast
There are High Contrast improvements in various WPF controls and they are visible when High Contrast theme is set.
Expander control
The focus visual for the expander control is now visible. The keyboard visuals for combo-box, list-box and radio buttons are visible as well.
Before:
After:
CheckBox and RadioButton
The text in CheckBox and RadioButton is now easier to see when selected in high contrast themes.
Before:
After:
ComboBox
The border of a disabled ComboBox is now the same color as disabled text.
Before:
After:
Disabled and focused buttons use the correct theme color.
Before:
After:
Setting a ComboBoxâs style to Toolbar, ComboBoxStyleKey caused the dropdown arrow to be invisible, this issue is now fixed.
Before:
After:
DataGrid
The sort indicator arrow in DataGrid now uses correct theme colors.
Before:
After:
Previously, default link style changed to incorrect color on mouse over in high contrast modes and this is now resolved. Similarly, DataGrid checkbox column now uses the expected colors for keyboard focus feedback.
Before:
After:
WCF SDK Tools Accessibility Improvements
.NET Framework 4.7.1 SDK tools â SvcConfigEditor.exe and SvcTraceViewer.exe have improved accessibility in the following areas:
One of the key improvements in SvcConfigEditor.exe is the new Diagnostics screen. In previous versions of SvcConfigEditor, the Performance Counter toggle link had no way of displaying which options where available. It was unclear how to enable and/or disable features, and keyboard navigation was limited and unpredictable. Since most of the GUI design was based on labels without action controls, screen readers failed to read and highlight the items correctly, and labels with colors not compatible with different high-contrast settings where abundantly used.
Before:
After:
Screen Readers
You can observe the following accessibility improvements in the screen reader area in .NET Framework 4.7.1 SDK.
High Contrast
WCF SDK tools have improved varied controls where they are now more visible when High Contrast theme is set. You can refer to the following example of high contrast improvement in SvcConfigEditor.exe. There are many other similar improvements.
Before:
After:
Keyboard Focus Order and Keyboard Navigation
In .NET Framework 4.7.1 WCF SDK tools have improved UI keyboard focus order to make it more logical for keyboard access, and improved some controls to be keyboard accessible. You can refer to the following examples:
WPF â Changing implicit data templates
This feature enables the automatic update of elements that use implicit DataTemplates after changing a resource. When an application adds, removes, or replaces a value declared in a ResourceDictionary, WPF automatically updates all elements that use the value in most cases, including the implicit style case: <Style TargetType=âButtonâ. Here the value should apply to all buttons in the scope of the resource. This feature supports a similar update in the implicit data template case where the value should apply to all in-scope ContentPresenters whose content is a Book: <DataTemplate DataType=â{x:Type local:Book}â>
This featureâs principal client is Visual Studioâs âEdit-and-Continueâ facility, when a user changes a DataTemplate resource in a running application and expects to see the effect of that change when the application continues. However it could also prove useful to any application with changing DataTemplate resources.
The feature is controlled by a new property ResourceDictionary.InvalidatesImplicitDataTemplateResources. After setting this to True, any changes to DataTemplate resources in the dictionary will cause all ContentPresenters in the scope of the dictionary to re-evaluate their choice of DataTemplate. This is a moderately expensive process â our recommendation is to not to enable it unless you really need it.
WPF â Distinguishing dynamic values in a template
This feature enables a caller to determine whether a value obtained from a template is âdynamicâ. Diagnostic assistants, such as Visual Studioâs âEdit-and-Continueâ facility, need to know whether a templated value is dynamic, in order to propagate a userâs changes correctly.
The feature is implemented by a new method on the class DependencyPropertyHelper:
This returns true if the templateâs value for the given property is âdynamicâ, that is if it declared via DynamicResourceReference or TemplateBinding, or via Binding or one of its derived classes.
WPF â SourceInfo for elements in templates
Diagnostic assistants such as Visual Studioâs âEdit-and-Continueâ facility can use SourceInfo to locate the file and line number where a given element was declared. The SourceInfo is now available for elements declared in a template loaded from XAML (as opposed to compiled BAML). This enables diagnostic assistants to do a better job. This feature is enabled automatically whenever SourceInfo itself is enabled.
Supple free download. Play as Arin Costello, the style editor.
WPF â Enable Visual Diagnostics
This feature provides a number of ways to control the VisualDiagnostics features. Diagnostic assistants can request WPF to share internal information. This feature gives both the assistant and the application developer more control over when this sharing is enabled.
The VisualDiagnostic features in WPF, with their introduction in .NET Framework 4.6, were initially only enabled when a managed debugger was attached. However, scenarios have arisen involving other components (besides a debugger) that can reasonably be considered as a diagnostic assistant, e.g. Visual Studioâs design surface. Thus, the need for a public way to control the features. The feature is controlled by two new methods on the class VisualDiagnostics, and by a number of registry keys, app-context switches, and environment variables.
The methods enable and disable the VisualTreeChanged event. You can only enable this event in a âdiagnostic scenarioâ, defined as one of the following:
Changes to the visual tree are disallowed while a VisualTreeChanged event is in progress. Specifically, an InvalidOperationException is thrown by any of the following actions:
This guards against unexpected and unsupported re-entrancy.
It is possible to override this InvalidOperationException, should you encounter a situation where debugging is impeded by it. To do so, add the following AppContext Switch to the <runtime> section of the app config file and set it to true,
Switch.System.Windows.Diagnostics.AllowChangesDuringVisualTreeChanged
None of the features mentioned here are supported in production applications. They are intended only for diagnostic assistance.
Finally, you may want to run your application under the debugger, but in âproduction modeâ without any potential interference from the VisualDiagnostic features. To do so, add the following AppContext Switch to the <runtime> section of the app config file and set it to true,
Switch.System.Windows.Diagnostics.DisableDiagnostics
Closing
Please try out these improvements in the .NET Framework and let us know what you think. Please share your feedback in the comments below or on GitHub.
.NET Framework (pronounced as 'dot net') is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library named as Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment (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 user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and 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 largely 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.
.NET Framework led to a family of .NET platforms targeting mobile computing, embedded devices, alternative operating systems, and web browser plug-ins. A reduced version of the framework, .NET Compact Framework, is available on Windows CE platforms, including Windows Mobile devices such as smartphones. .NET Micro Framework is targeted at very resource-constrained embedded devices. Silverlight was available as a web browser plugin. Mono is available for many operating systems and is customized into popular smartphone operating systems (Android and iOS) and game engines. .NET Core targets the Universal Windows Platform (UWP), and cross-platform and cloud computing workloads.
History[edit]
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 late 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 Ecma International (ECMA) standards.[2][3]International Organisation for Standardisation (ISO) followed in April 2003. The current version of ISO standards are ISO/IEC 23271:2012 and ISO/IEC 23270:2006.[4][5]
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 for the part of .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.[6]
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]).[7] 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.[8]
Microsoft .NET Framework v4.5 logo
On November 12, 2014, Microsoft announced .NET Core, in an effort to include cross-platform support for .NET, the source release of Microsoft's CoreCLR implementation, source for the 'entire [â¦] library stack' for .NET Core, and the adoption of a conventional ('bazaar'-like) open-source development model under the consolation stewardship of the .NET Foundation. Miguel de Icaza describes .NET Core as a 'redesigned version of .NET that is based on the simplified version of the class libraries',[9] and Microsoft's Immo Landwerth explained that .NET Core would be 'the foundation of all future .NET platforms'. At the time of the announcement, the initial release of the .NET Core project had been seeded with a subset of the libraries' source code and coincided with the relicensing of Microsoft's existing .NET reference source away from the restrictions of the Ms-RSL. Landwerth acknowledged the disadvantages of the formerly selected shared license, explaining that it made codename Rotor 'a non-starter' as a community-developed open source project because it did not meet the criteria of an Open Source Initiative (OSI) approved license.[10][11][12]
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.[13]
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.[14] 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.'[15][16] 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.[17]
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.[18]
On May 8, 2019, Microsoft announced .NET 5.0, will be released on November 2020, which will be based on .Net Core.[19]
Release history[edit]Architecture[edit]
Visual overview of the Common Language Infrastructure (CLI)
Common Language Infrastructure[edit]
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[edit]
.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.
With Microsoft's move to .NET Core, the CLI Virtual Execution System (VES) implementation is known as CoreCLR instead of CLR.
Assemblies[edit]
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 executableEXE 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 identifies which private key an assembly is signed with. Only the creator of the key pair (typically the person signing the assembly) can sign assemblies that have the same strong name as a prior version assembly, since the creator possesses the private key. 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.[20]
Class library[edit]
.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.
Lightscribe cd label software. 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.[21] 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 its 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 an expanded set of libraries, including BCL, Windows Forms, ASP.NET, and Windows Presentation Foundation (WPF) but 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 implementations (e.g., Silverlight), Microsoft introduced the concept of Portable Class Libraries (PCL) allowing a consuming library to run on more than one platform. With the further proliferation of .NET platforms, the PCL approach failed to scale (PCLs are defined intersections of API surface between two or more platforms).[22] 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 .NET platforms are encouraged to implement a version of the standard library allowing them to re-use extant third-party libraries to run without new versions of them. The .NET Standard Library allows an independent evolution of the library and app model layers within the .NET architecture.[23]
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.[24] Private feeds can be maintained separately, e.g., by a build server or a file system directory.
With Microsoft's move to .NET Core, the CLI foundational class libraries implementation is known as CoreFX instead of FCL.
App models[edit]
Atop the class libraries, multiple app models are used to create apps. .NET Framework supports Console, Windows Forms, Windows Presentation Foundation, ASP.NET and ASP.NET Core apps by default. Other app models are offered by alternative implementations of the .NET Framework. Console, UWP and ASP.NET Core are available on .NET Core. Mono is used to power Xamarin in app models for Android, iOS, and macOS. The retroactive architectural definition of app models showed up in early 2015 and was also applied to prior technologies like Windows Forms or WPF.
C++/CLI[edit]
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.[25] Such assemblies are more complex to reverse engineer, since .NET decompilers such as .NET Reflector reveal only the managed code.
Design principle[edit]Interoperability[edit]
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 reverse P/Invoke function.
Language independence[edit]
.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 specification. Because of this feature, .NET Framework supports the exchange of types and object instances between libraries and applications written using any conforming .NET language.
Type safety[edit]
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.
Net Framework Windows 10Portability[edit]
While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be cross-platform,[26] and implementations are available for other operating systems (see Silverlight and § Alternative implementations). Microsoft submitted the specifications for CLI (which includes the core class libraries, CTS, and CIL),[27][28][29]C#,[30] and C++/CLI[31] 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.
Security[edit]
.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. Other code can demand that calling code be granted a specified permission. The demand causes CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission; if any assembly is not granted the permission a security exception is thrown.
ManagedCIL bytecode is easier to reverse-engineer than native code, unless obfuscated.[32][33] .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.[34] 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[edit]
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.[35] 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.[35] This is the mark phase.[36] 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.[35][36] Any reference to an object invalidated by moving the object is updated by GC to reflect the new location.[36] 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.[37]
The garbage collector used by .NET Framework is also generational.[38] 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.[38] 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.[38] By ignoring older objects in most collection runs, fewer checks and compaction operations are needed in total.[38]
Performance[edit]
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.[39][40] 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.[40]
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.'[41]
.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.[42] Mono's lead developer Miguel de Icaza has expressed hope that this SIMD support will be adopted by CLR's ECMA standard.[43] 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.[44]
Alternative implementations[edit]
.NET Framework is the predominant implementation of .NET technologies. Other implementations for parts of the framework exist. Although the runtime engine is described by an ECMA-ISO specification, other implementations of it may be encumbered by patent issues; ISO standards may include the disclaimer, 'Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO shall not be held responsible for identifying any or all such patent rights.'[45] 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.
Licensing[edit]
Microsoft managed code frameworks and their components are licensed as follows:
See also[edit]
Microsoft Net Framework 4.7 1 Web InstallerNotes[edit]
References[edit]
External links[edit]
Retrieved from 'https://en.wikipedia.org/w/index.php?title=.NET_Framework&oldid=919038087'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |