Thursday 21 April 2016

.NET Framework 4.6



.NET Framework 4.6 was announced on 12 November 2014. It was released on 20 July 2015. It supports a new just-in-time compiler (JIT) for 64-bit systems called RyuJIT, which features higher performance and support for SSE2 and AVX2 instruction sets. WPF and Windows Forms both have received updates for high DPI scenarios. Support for TLS 1.1 and TLS 1.2 has been added to WCF.
The cryptographic API in .NET Framework 4.6 uses the latest version of Windows CNG cryptography API. As a result, NSA Suite B Cryptography is available to .NET Framework. Suite B consists of AES, the SHA-2 family of hashing algorithms, elliptic curve Diffie–Hellman, and elliptic curve DSA.
The new features and enhancements in .NET Framework 4.6 include the following:
  1. Updates to the Base Class Library (BCL)
  2. Support for RyuJIT
  3. Event tracing enhancements
  4. Support for code page encodings
  5. Other enhancements
  6. .NET Native
I will run through the new features and enhancements in .NET Framework 4.6 in the sections that follow.
Updates to Base Class Library (BCL)
The Base Class Library (BCL) is a collection of types in .NET Framework. There have been some major updates to the Base Class Library (BCL). In the earlier versions of .NET Framework the CultureInfo.CurrentCulture and CultureInfo.CurrentUICulture properties were read only.
With .NET Framework 4.6, these properties are now read-write. So, if you assign a CultureInfo instance to either of these properties, the CurrentCulture and CurrentUICulture properties would also be updated to reflect the change.
Support for RyuJIT
Just in Time compiler (JIT) as the name suggests, compiles your byte code to machine readable code at run time — hence the name. Microsoft .NET Framework 4.6 provides support for next generation JIT compiler named RyuJIT. This is a 64-bit JIT compiler that is much improved and optimized for use in systems that support 64-bit computing. This release of JIT has fixed the reported bugs in the earlier versions of JIT and includes SMID improvements also. There is a major improvement in the startup time with this optimized JIT.
Event Tracing Enhancements
Event tracing is now improved in .NET Framework 4.6. You can now create an EventSource instance and invoke one of its Write() methods.
using System.Diagnostics.Tracing
public void Write<T>(
string eventName,
T data
)
Support for Code Page Encodings
Support for code page encoding is now available. You need to add a reference to the System.Text.Encoding.CodePages.dll assembly to take advantage of this feature. The CodePagesEncodingProvider class enables access to an encoding provider for code pages. You would then need to register code page encodings using the Encoding.RegisterProvider method.
Note that this is only supported in the desktop .NET Framework and not in the preview version of .NET Framework 4.6. For your information, Microsoft .NET Framework 4.6 Preview provides support for the following encodings only:
  • ASCII (code page 20127)
  • ISO-8859-1 (code page 28591)
  • UTF-7 (code page 65000)
  • UTF-8 (code page 65001)
  • UTF-16 and UTF-16LE (code page 1200)
  • UTF-16BE (code page 1201)
  • UTF-32 and UTF-32LE (code page 12000)
  • UTF-32BE (code page 12001)
Other Enhancements
Microsoft .NET Framework 4.6 includes Immutable Collections and SIMD APIs — these are now available in GitHub as open source. There have been enhancements in the collection framework as well. The following new collection classes have been introduced.
System.Collections.ObjectModel.ReadOnlyCollection
System.Collections.Generic.Queue
System.Collections.Generic.Stack
Some new cryptography APIs have also been introduced — these include the following:
SymmetricAlgorithm.KeyExchangeAlgorithm
AsymmetricAlgorithm.SignatureAlgorithm
System.Security.Cryptography.X509Certificates.X509Certificate
The Microsoft .NET Framework provides a platform for building applications targeted at a managed runtime environment. Microsoft .NET Framework 4.6 ships with Visual Studio 2015 and comes with features aplenty. In this article we explored the new features and enhancements in .NET Framework 4.6. Happy reading!

No comments:

Post a Comment