C#

What’s New In Microsoft .NET Framework 4.7.1

Introduction

Microsoft announced the release of .NET framework 4.7.1 on October 17, 2017. It is included in Windows 10 Fall Creators Update. It is available on Windows 7 and up and Windows Server 2008 R2 and up. It is also available with Visual Studio 2017 Version 15.5.

You can download this latest framework from here.

Let’s explore the features of .NET framework 4.7.1.

Support for .NET Standard 2.0

It has built in support for .NET Standard 2.0, which adds 200 new APIs to .NET framework. Since .NET Standard 2.0 specifications were finalized post release of .NET framework 4.6.1,  for an application to target framework 4.6.1 through 4.7, it must deploy additional support files for .NET Standard 2.0 in order to consume .NET Standard 2.0 libraries.

GC Performance improvements

To boost memory allocation performance, particularly for large object heap allocations, an architectural change has been introduced in the garbage collector to split the heap allocation into small and large object heaps. This will make the applications creating a lot of large object heap allocations experience a reduction in allocation lock contention and have better performance. 

ASP.NET Forms Authentication

A new and secure SHA-2, successor to SHA-1 hash algorithm has been introduced for forms authentication. SHA-2 includes options like SHA-256, SHA-384 and SHA-512. SHA-2 is also supported for Message.HashAlgorithm, which specifies the hash algorithm used by message queuing when authenticating. To maintain compatibility, SHA-1 is still the default option. To know more about SHA-2 algorithm refer here.

Configuration Builders

Unlike previous versions of .NET framework, the newly introduced configuration builders allow the developers to inject and build configurations for applications at runtime. Through configuration builders, applications are able to apply a custom-defined set of builders to a section of config and these builders can modify the configuration data of a particular config section. To implement custom Configuration Builder, we need to inherit from the System.Configuration.ConfigurationBuilder base class.

Execution Step Invoker

With the introduction of new ExecutionStepInvoker feature, the execution steps can be run inside the code rather than ASP.NET predefined pipelines. This is intended for libraries that are concerned for execution flow of application. A new API HttpApplication.OnExecuteRequestStep has been added to enable this feature.

HTTPCookie parsing

A new API HttpCookie.TryParse provides a standardized way to build HttpCookieobject from a string and capture cookie properties such as expiration date and path.

Support for ReadOnlyReferences in CIL

IsReadOnly attribute has been introduced for ReadOnlyReference feature, which is also a part of C# 7.2. This attribute enables the compiler to mark members that have readonly ref return type or parameter at CIL level.

Support for runtime feature detection in compiler

A newly introduced API will determine whether a runtime supports a particular feature or not. This API will be consumed by complier. At compile time the API will do that statically through reflection. To check for the runtime support it will look for a corresponding well known enum member, if the member exists then the feature check is successful, it means the feature is supported and value for that enum member is ignored. This feature will prevent compiling the code that we know will fail against a particular runtime.

Accessibility improvements

New accessibility improvements in Windows Forms includes – improved display in high contrast mode, enhancements in screen Narrator and UI accessibility pattern.

New accessibility improvements in WPF includes Live Region support, improved features in screen Narrator and high contrast enhancements.

New accessibility improvements in WCF SDK tools includes – improvements in screen Narrator, high contrast improvements, Keyboard focus order and keyboard navigation.

WPF new features

WPF has got few new features in this new release of .NET framework.

It includes features to automatically update the element that uses implicit DataTemplates after changing a resource and this is controlled by a new property ResourceDictionary.InvalidatesImplicitDataTemplateResources.

Another new feature will enable a caller to distinguish dynamic values in a template. This feature is implemented by a new method DependencyPropertyHelper.

New feature will provide more control over VisualDiagnostics features. To provide control over sharing of internal information, diagnostic assistants can request WPF to share this information, which provides both assistant and app developer more control. Two new methods have been introduced on the class VisualDiagnostics.

  1. public static void EnableVisualTreeChanged();
  2. public static void DisableVisualTreeChanged();

Conclusion

We have discussed some of the major changes introduced as part of .NET framework 4.7.1 release. You can refer to the official release notes for detailed information here

You can also find this article at C# Corner

You can read my other articles on C# here

Ankit Sharma

Full Stack Consultant | GDE for Angular | Microsoft MVP | Author | Speaker | Passionate Programmer

View Comments

Recent Posts

Announcing A New Blazor Course

Introduction Blazor is a .NET web framework that allows us to create client-side applications using…

3 years ago

How To Solve Sudoku Using Azure Form Recognizer

Introduction In this article, we are going to create a sudoku solver with the help…

4 years ago

Going Serverless With Blazor

Introduction In this article, we will learn how to implement Azure serverless with Blazor web…

5 years ago

Announcing A Free eBook On Angular and Firebase

Introduction Angular is an open-source framework that allows us to create applications for multiple platforms…

5 years ago

Optical Character Reader Using Angular And Azure Computer Vision

Introduction In this article, we will create an optical character recognition (OCR) application using Angular…

5 years ago

Optical Character Reader Using Blazor And Computer Vision

Introduction In this article, we will create an optical character recognition (OCR) application using Blazor…

5 years ago