This post describes the new ASP.NET, Configuration and System.Messaging features and improvements in the .NET Framework 4.7.1. More information on the build these features are available in and how to get the Developer Pack is covered in the Welcome to the .NET Framework 4.7.1 Early Access blog post.
Here are some code samples that will enable you to declare, use and apply configuration builders.
ASP.NET Execution Step Feature
We have added a new API to enable this: HttpApplication.OnExecuteStep(Action<HttpContextBase, Action> callback)
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.
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 SHA1. Now new secure SHA-2 hash options like SHA256, SHA384 and SHA512 are added in .NET Framework 4.7.1. SHA1 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 a user code specified a System.Messaging HashAlgorithm value, it was limited to MD5 and Sha1. With .NET Framework 4.7.1, there is support for HashAlgorithm values for Sha256, Sha384, and Sha512 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.
Try out these new features in .NET Framework 4.7.1 Early Access build shared and please provide your feedback by reporting an issue at the .NET Framework Early Access GitHub repository. Stay tuned for further feature overviews in .NET Framework 4.7.1.