.NET Framework 4.6.2 Available Now

Microsoft has announced the availability of .NET Framework 4.6.2.

Microsoft has announced the availability of .NET Framework 4.6.2.

The company states,

“Today we are excited to announce the availability of the .NET Framework 4.6.2! Many of the changes are based on your feedback, including those submitted on UserVoice and Connect. Thanks for your continued help and engagement!”

This release comes with several great improvements in the following areas:

  • Base Class Library
  • Common Language Runtime
  • ClickOnce
  • SQL
  • Windows Presentation Foundation
  • Windows Communication Foundation

Base Class Library (BCL)

For the BCL, Microsoft has come up with improvements in the following area:

Long Path Support (MAXPATH)

The company has gone on to fix the 260 character (MAXPATH) file name length limitation in the System. IO APIs.

Microsoft states,

“Over 4500 of you voted for this issue on UserVoice!

This limitation does not usually affect consumer applications, (for example loading files out of “My Documents”), however, it is most commonly on developer machines which goes on to build the deeply nested source trees or use specialized tools which will also run on Unix.

This new capability has been enabled for applications which targets .NET Framework 4.6.2 or later. You will be able to easily configure an application in order to target the .NET Framework 4.6.2 with the app.config or web.config configuration file given below:


Image Source: blogs.msdn.microsoft.com

You can also go on to opt for applications which target a previous version of .NET Framework into using this particular functionality by setting an AppContext switch, as demonstrated in the configured file given below. The switch will only be honored when an application is running on the .NET Framework 4.6.2 or later.


Image Source: blogs.msdn.microsoft.com

The absence of targeting the .NET Framework 4.6.2 or setting the AppContext switch results in the existing behavior of being blocked from using paths longer than MAXPATH. The behavior is opt-in to maintain backwards compatibility for existing applications.

The following improvements have been made so as to enable the long paths, as per the official blog:

  • It allows the paths which are greater than 260 character (MAX_PATH). Paths which are longer than MAX_PATH are now allowed by the BCL. The BCL APIs rely on the underlying Win32 files APIs for limitation checks.
  • It enables extended path syntax and file namespaces (\\?\, \\.\). Windows goes on to expose multiple file namespaces which enable alternative path schemes, such as the extended path syntax, which allows paths to just over 32k characters. The BCL now supports these paths such as the following: \\?\very long path. The .NET Framework now primarily relies on Windows for path normalization, treating it as the “source of truth”, to avoid inadvertently blocking legitimate paths. The extended path syntax is a good workaround for Windows versions that don’t support long paths using the regular form (for example, `C:\very long path’).
  • Performance Improvements. The adoption of Windows path normalization and the reduction of similar logic in the BCL has resulted in overall performance improvements for logic related to file paths. Other related performance improvements have also been made.

X509 Certificates Now Support FIPS 186-3 Digital Signature Algorithm

The .NET Framework 4.6.2 adds support for FIPS 186-3 Digital Signature Algorithm (DSA). This support enables X509 certificates with keys that go on to exceed 1024-bit. It also goes on to enable computing signatures with the SHA-2 family of hash algorithms (SHA256, SHA384, and SHA512).

The .NET Framework 4.6.1 supports FIPS 186-2 which is limited to keys with no greater than 1024-bit. You can now easily take advantage of FIP 186-3 support by going on to use the new DSACng class.

The DSA base class has also been update by Microsoft, so you will now be able to use FIPS 186-3 support without casting to the new DSACng class. This is quite similar as the approach which has been used for updating RSA and ECDsa implementations, in two earlier version of .NET Framework releases.

Improved Usability of Elliptic Curve Diffie-Hellman Key Derivation Routines

The usability of the ECDiffieHellmanCng class has been improved. The .NET Framework Elliptic Curve Diffie-Hellman (ECDH) Key Agreement implementation goes on to include three different Key Derivation Function (KDF) routines. These KDF routines are at the moment represented and supported by three different methods.

Support for Persisted-Key Symmetric Encryption

The Windows Cryptography Library (CNG) goes on to support storing persisted symmetric keys on software and hardware devices. The .NET Framework now goes on to expose this CNG capability.

You will require to use the concrete implementation classes, such as AesCang in order to use this new capability, as opposed to the more common factory approach, Aes.Create(). This requirement is mainly due to the key names and key providers being implementation – specific.

Microsoft has persisted-key symmetric encryption has been added for the AES and 3DES algorithms, in the AesCng TripleDESCng classes, respectively.

SignedXml Support for SHA-2 Hashing

The .NET Framework SignedXml implementation now supports the following SHA-2 Hashing algorithms:

  • RSA-SHA256
  • RSA-SHA384
  • RSA-SHA512 PKCS#1 signature methods
  • SHA256
  • SHA384
  • SHA512 reference digest algorithms

The new SignedXML URL constants have been added as new SignedXml fields.

Any program which have registered a custome SignatureDescription handler into CryptoConfig to add support for these algorithms which will go on to continue to function as they did earlier, however now that they platform defaults CryptoConfig registration is should no longer be necessary.

Common Language Runtime (CLR)

The CLR now comes with the following improvements:

NullReferenceException Improvements

Microsoft states,

“You have probably experienced and investigated the cause of a NullReferenceException. We are part-way through partnering with the Visual Studio team to provide a better debugging experience for null references in a future Visual Studio release.”


Image Source: blogs.msdn.microsoft.com

The debugging experience in Visual Studio relies on the Common Language Runtime debugging APIs for low-level interaction with your code. Now the NullReferenceException experience in The Visula Studio, looks like the image provided below:

The company states,

“In this release, we extended the CLR debugging APIs to enable the debugger to request more information and perform additional analysis when a NullReferenceException occurs. Using this information, a debugger will be able to determine which reference is null and provide this information to you, making your job easier.”


ClickOnce now comes with the following improvements:

Transport Layer Security (TLS) 1.1 and 1.2 Support

Microsoft states,

“We added support for TLS 1.1 and 1.2 protocols in ClickOnce for .NET Framework versions 4.6.2, 4.6.1, 4.6 and 4.5.2. We would like to thank those who voted for it on UserVoice! You do not need to do any extra steps to enable TLS 1.1 or 1.2 support as ClickOnce will automatically detect which TLS protocol is required at runtime.”

Secure Sockets Layer (SSL) and TLS 1.0 are no longer recommended or supported by some organizations.

ClickOnce will go on to continue supporting TLS 1.0 for applications which do no or which cannot upgrade, for compatibility. The company recommends that you should first analyze all your uses of SSL and TLS 1.0.

Client Certificate Support

ClickOnce applications will now be hosted in virtual directories with SSL enabled and with client certification required. In this particular configuration, end users will be prompted to select their certificate while accessing an application. ClickOnce will also not prompt for a certification if the Client Certification setting is set to “Ignore.”


The following improvements have been made in ASP.NET.

DataAnnotation Localization

Localization is now comparatively easier than before when you had to use model binding and DataAnnotiation validation. ASP.NET has adopted a simple convention for resx resource files which goes on to contain DataAnnotation validation messages:

  • Located in the App_LocalResources folder.
  • Follow the DataAnnotation.Localization.{locale}.resx naming convention.

Using the .NET Framework 4.6.2 would specify DataAnnotation attributes in your model files in the similar manner you would in an un-localized application. For ErrorMessage, you can go on to specify the name which will be used in resx file.

You will be able to see that localized resx files have been placed in the ‘App_LocalResources’ folder, following the new convention.

You can now also plug in your own stringlocalizer provider in order to store the localized strings in another location or file type.

Async Improvements

SessionStateModule and Output-Cache Module have been improved to enable async scenarios.

SessionStateModule Interfaces

Session State allows you to store and retrieve user session data as a user navigates an ASP.NET site. You can now create your own asyncSession State Module implementation using the new ISessionStateModule interface, enabling you to store session data in your own way and use async methods.

Output-Cache Module

Output Caching can spectacularly improve the performance of an ASP.NET application by caching the result returned from a controller action so as to avoid unnecessarily generating the same content for every request.

You will now also be able to use async APIs with Output Caching by implementing a new interface called OutputCacheProviderAsync. This will go on to reduce thread-blocking on a web server and also improve scalability of an ASP.NET service.


The following improvements have been made in the SQL client.

Always Encrypted Enhancements

Always Encrypted is a feature which has been designed to protect sensitive data, such as credit card numbers or national identification numbers that are stored in a database. It will allow the clients to encrypt sensitive data inside the client applications, never revealing the encryption keys to the database engine. Hence, the always encrypted goes on to provide separation between those who own the data and those who manage the data.


In order to improve performance of parameterized queries against encrypted database columns, encryption metadata for query parameters is now cached. Database clients retrieve parameter metadata from the server only once when theSqlConnection::ColumnEncryptionQueryMetadataCacheEnabled property is set to default, even if the same query is called multiple times.


Column encryption key entries in the key cache are now quite evicted after a configurable time interval. The time interval can be set using theSqlConnection::ColumnEncryptionKeyCacheTtl property.

Windows Communication Foundation (WCF)

The following improvements have been made in WCF.

NetNamedPipeBinding Best Match

In .NET 4.6.2, NetNamedPipeBinding has been enhanced so as to support new pipe lookup, known as “Best Match”. When you are using “Best Match”, the NetNamedPipeBinding service will go on to force clients to search for the service listening at the best matching URI to their requested endpoint, rather than the first matching service found.

The “Best Match” is mainly useful if a WCF client app tries to connect to the wrong URI while using the default “First Match” behavior.

In particular situations when there is more than one WCF Services listening on named pipes, WCF clients using “First Match” could be connected to the wrong service. This would go on to happen if some of the services are hosted by an administrator account.

In order to enable this particular feature, all you need to do is add the following AppSetting to your client application’s App.config or Web.config file.

DataContractJsonSerializer Improvements

Microsoft has also improved DataContractJsonSerializer, for better support multiple daylight saving time adjustment rules. While enabling DataContractJsonSerializer you will be able to use the TimeZoneInfo class instead of the TimeZone class. The TimeZoneInfo class supports numerous adjustment rules, which goes n to make it quite possible to work with historic time zone data. This is particularly useful when the time zone has different daylight saving time adjustment rules such as (UTC+2) Istanbul.

TransportDefaults No Longer Supports SSL 3

The SSL 3 protocol is no more a default protocol which is used for negotiating a secure connection while using NetTcp with transport security and a credential type of certificate.

The company states,

“In most cases there should be no impact to existing applications, since TLS 1.0 has always been included in the default protocol list for NetTcp. All existing clients should be able to negotiate a connection using at least TLS 1.0.

The company informed that the SSL 3 was removed as a default protocol as it no longer considered being secured.

Transport Security for Windows Cryptography Library (CNG)

The Transport Security now goes on to support certificates stored using the Windows cryptography library (CNG). Currently, this support is limited to using certificates with a public key which has an exponent no more than 32bits in length.

This new capability is enabled for applications which targets the .NET Framework 4.6.2 or later. You will now be able to configure an application so as to target the .NET Framework 4.6.2 with app.config or web.config configuration file.

The company states,

“You can opt applications that target an earlier version of the .NET Framework into using this functionality by setting an AppContext switch, as demonstrated in the following configuration file. The switch will only be honored when an application in running on the .NET Framework 4.6.2 (or later).”

OperationContext.Current Async Improvements

WCF now comes with the ability to include OperationContext Current with ExecutionContext so that the OperationContext flows through asynchronous continuations.

Windows Presentation Foundation (WPF)

The following improvements have been made in WPF.

Group Sorting

Microsoft states,

“An application that requests a CollectionView to group data can now explicitly declare how to sort the groups. This overcomes some unintuitive ordering that can arise when the application dynamically adds or removes groups, or when the application changes the value of item properties involved in grouping. It can also improve the performance of the group creation process, by moving comparisons of the grouping properties from the sort of the full collection to the sort of the groups.”

The feature includes two new properties the GroupDescriptionclass: SortDescriptions and CustomSort. These properties goes on to describe how to sort the collection of groups produced by the GroupDescription, analogous to the way the properties onListCollectionViewwith the same name describe how to sort the data items.

There are also two new static properties on the PropertyGroupDescriptionclass for use in the most common cases: CompareNameAscending and CompareNameDescending.

Per-Monitor DPI Support

The WPF applications now go on to enable pre-monitor DPI awareness. This goes on to improve critical scenarios where several displays of varying DPI level are attached to a single machine.

Soft Keyboard Support

Soft Keyboard support enables automatic invocation and dismissal of the touch keyboard in WPF applications without disabling WPF stylus/touch support on Windows 10.


Image Source: blogs.msdn.microsoft.com

Microsoft concluded by saying,

“Once again, we would like to thank everyone who provided feedback on the 4.6.2 preview release! It has been instrumental in making 4.6.2 a great release.”