What’s new in Microsoft .NET Framework 4.6?

DevToolsGuy / Friday, April 3, 2015


The .NET Framework was been taking up a fair amount of time in the tech press in recent months, mainly due to Microsoft's bold move to open source much of the technology. One announcement you may have missed was the release back in November of a preview version of .NET 4.6. In this post we take a look at what you can expect.

The .NET Framework

The .NET Framework is a development platform for building apps for Windows, Windows Phone, Windows Server, and Microsoft Azure. It consists of the common language runtime (CLR) and the .NET Framework class library, which includes classes, interfaces, and value types that support an extensive range of technologies.

The most recent official release of .NET was 4.5.2. Version 4.6 is currently only in preview, so what’s new?

What’s new in version 4.6?

When you install .NET 4.6 Preview it will actually be installed as .NET, partly to maintain (in-place) compatibility with previous versions (4, 4.5, 4.5.1 and 4.5.2). This means that if you have one of the above mentioned frameworks installed on your computer, this installer will upgrade them to 4.6 while if you have older frameworks installed like 3.5, 2.0, 1.1 etc., then it will run alongside them.

Important note: Before downloading and installing this preview version, please remember that Visual Studio 2015 Preview and .NET 4.6 Preview are for testing and feedback purposes only and not for a production environment.

There are three key areas to look at:

  1. Open Source .Net Framework Packages
  2. Support for Code page encodings
  3. Improvements to event tracing

1. Open Source .Net Framework Packages

.NET Core 5 is a modern, componentized framework that ships via NuGet. That means you can ship a private version of the .NET Core Framework with your app. Other apps' versions can't change your app's behavior.

.NET Core CLR is built for Windows, Mac and Linux and it will be both open source and it will be supported by Microsoft. Some of the .NET packages like Immutable collections and SIMD APIs are available on GitHub. All these packages are licensed under the MIT license. Microsoft are also open sourcing RyuJit and .NET GC, and making them both cross-platform.

There is a new free SKU for Visual Studio for open source developers and students called Visual Studio Community. which supports extensions. 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

GitHub contains the foundation libraries that make up the .NET Core development stack:

  • Share a collection in such a way that its consumer can be assured it will never change.
  • Provide implicit thread safety in multi-threaded applications. No locks required to access collections.
  • Follow functional programming practices.
  • Modify a collection during enumeration, while ensuring that the original collection does not change.

How are these things helpful?

Having the .NET framework Packages open source is very useful for developers who will benefit from a fully supported, fully open source, fully cross platform stack for creating server and cloud applications. It will allow the .NET teams in Microsoft to collaborate even more effectively with other developers around the world. 

2. Support for code page encodings

.NET Core primarily supports Unicode encodings, and by default it provides limited support for code page encodings. You can add support for code page encodings that are available in the .NET Framework but unsupported in .NET Core by registering code page encodings with the Encoding.RegisterProvider method. We need to use the namespace:


So to make these code pages available to .NET 4.6 you can use these additional code pages:

  • Add a reference to the System.Text.Encoding.CodePages.dll assembly to your project.
  • Retrieve a CodePagesEncodingProvider object from the static Instance property.
  • Pass the CodePagesEncodingProvider object to the Encoding.RegisterProvider method. 


The .NET Framework for the Windows Desktop supports a large set of Unicode and code page encodings. .NET Framework 4.6 Preview supports only the following encodings:

  • 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)

How are these things helpful?

The most common problems in encoding operations occur when a Unicode character cannot be mapped to a particular code page encoding. The most common problems in decoding operations occur when invalid byte sequences cannot be translated into valid Unicode characters. With new support for code page encodings, developers do not have to worry about the fallback strategy for an object encoding to be used.

3. Improvements to event tracing

An EventSource object can now be constructed directly, and you can call one of the Write() methods to emit a self-describing event

EventSource provides channel support and some of the event source validation rules have been relaxed. This means:

  • EventSource types may now implement interfaces. This enables the use of event source types in advanced logging systems that use interfaces to define a common logging target.
  • The concept of a utility event source type has been introduced. This feature enables sharing code across multiple event source types in a project to enable scenarios such as optimized WriteEvent overloads.


using System.Diagnostics.Tracing 

//Assembly: mscorlib (in mscorlib.dll) 


public void Write( 

string eventName, 

T data 



In the above code, <T> is the type that defines the event and its associated data. This type must be an anonymous type or marked with the EventSourceAttribute attribute, eventName is the name of event and data is the object of type .

How are these things helpful?

The .NET Framework 4.6 enables out-of-process, Event Tracing for Windows (ETW)-based activity tracing for a larger surface area. This enables Advanced Power Management (APM) vendors to provide lightweight tools that accurately track the costs of individual requests and activities that cross threads. These events are raised only when ETW controllers enable them; therefore, the changes don't affect previously written ETW code or code that runs with ETW disabled. Hence increasing the performance of an application effectively.

.NET’s Future, today

Microsoft is now combining all of the various next-gen .NET components under a single umbrella. That includes .NET 4.6, the next update to the desktop .NET framework, which includes a number of tweaks to the Windows Presentation Foundation (WPF) subsystem. Also included is ASP.Net v5, which has been extensively re-engineered to be more modular for a ‘cloud first’ world. Other components are included with various versions numbering, with .NET 2015 as the overarching banner for this set of releases.

One big benefit of this new versioning scheme is that development of .NET will be able to proceed at a faster pace, particularly as it moves toward its open source future.