{"id":17125,"date":"2018-04-30T13:56:19","date_gmt":"2018-04-30T20:56:19","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/?p=17125"},"modified":"2021-09-29T16:28:35","modified_gmt":"2021-09-29T23:28:35","slug":"announcing-the-net-framework-4-7-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-net-framework-4-7-2\/","title":{"rendered":"Announcing the .NET Framework 4.7.2"},"content":{"rendered":"<p>Today, we are happy to announce the release of the\u00a0<a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=863262\">.NET Framework 4.7.2<\/a>. It\u2019s included in the\u00a0<a href=\"https:\/\/blogs.windows.com\/windowsexperience\/2018\/04\/30\/how-to-get-the-windows-10-april-2018-update\/\">Windows 10 April 2018 Update<\/a>. .NET Framework 4.7.2 is also available on Windows 7+ and Windows Server 2008 R2+.<\/p>\n<p>You can download the .NET Framework 4.7.2<\/p>\n<ul>\n<li><a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=863262\">Web Installer<\/a><\/li>\n<li><a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=863265\">Offline\u00a0Installer<\/a><\/li>\n<\/ul>\n<p>The\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/whats-new\/index#v472\">.NET Framework 4.7.2<\/a>\u00a0includes improvements in several areas:<\/p>\n<ul>\n<li><strong>[ASP.NET]<\/strong>\u00a0Support for SameSite cookie in\u00a0ASP.NET<\/li>\n<li><strong>[ASP.NET]<\/strong>\u00a0Support for ASP.NET Dependency Injection<\/li>\n<li><strong>[ClickOnce]<\/strong>\u00a0Per-monitor support for WPF and HDPI-aware VSTO apps deployed via ClickOnce<\/li>\n<li><strong>[SQL]<\/strong>\u00a0Always Encrypted enhancements in SQL Connectivity<\/li>\n<li><strong>[Networking &amp; BCL]<\/strong>\u00a0Enhanced .NET Framework support for .NET Standard 2.0<\/li>\n<li><strong>[BCL]<\/strong>\u00a0Cryptography improvements<\/li>\n<li><strong>[WPF]<\/strong>\u00a0Diagnostic enhancements<\/li>\n<\/ul>\n<p>For building applications targeting .NET Framework 4.7.2 download the\u00a0<a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=863261\">Developer Pack<\/a>.\u00a0You can see the complete list of improvements in the\u00a0<a href=\"https:\/\/github.com\/Microsoft\/dotnet\/tree\/master\/releases\/net472\/README.md\">.NET Framework 4.7.2 release notes<\/a>. .NET Framework 4.7.2 will be available on Windows Update in the near future. Docker images are also available for this release at <a href=\"https:\/\/hub.docker.com\/r\/microsoft\/dotnet-framework\/\">Docker Hub<\/a>.<\/p>\n<h2>Supported Windows Versions<\/h2>\n<p>The .NET Framework 4.7.2 is supported on the following Windows versions:<\/p>\n<ul>\n<li>Windows 10 April 2018 Update (included in-box)<\/li>\n<li>Windows 10 Fall Creators Update<\/li>\n<li>Windows 10 Creators Update<\/li>\n<li>Windows 10 Anniversary Update<\/li>\n<li>Windows 8.1<\/li>\n<li>Windows 7 SP1<\/li>\n<\/ul>\n<p>The .NET Framework 4.7.2 is supported on the following Windows Server versions:<\/p>\n<ul>\n<li>Windows Server, version 1709<\/li>\n<li>Windows Server 2016<\/li>\n<li>Windows Server 2012 R2<\/li>\n<li>Windows Server 2012<\/li>\n<li>Windows Server 2008 R2 SP1<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<h2>ASP.NET &#8211; Dependency Injection in WebForms<\/h2>\n<div>\n<div><a href=\"https:\/\/msdn.microsoft.com\/library\/ff921152.aspx\">Dependency injection<\/a>\u00a0(DI) is a technique whereby one object supplies the dependencies of another object. It decouples the objects so that no client code has to be changed simply because an object it depends on needs to be changed to a different one. <a href=\"https:\/\/msdn.microsoft.com\/library\/dd381412(v=vs.108).aspx\">MVC Framework<\/a>\u00a0already supports dependency injection, but it has been very difficult to use this technique in ASP.NET Web Forms application. This new feature will make it much easier to use dependency injection in ASP.NET Web Forms application. This feature enables the following:<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div>\n<ul>\n<li>Support setter-based, interface-based and constructor-based injection in web application project in Handler, Module, Page, User control and Custom control.<\/li>\n<li>Support setter-based and interface-based injection in web site project in Handler, Module, Page, User controls and Custom controls.<\/li>\n<li>Extensebility to support different dependency injection frameworks.<\/li>\n<\/ul>\n<div>\n<div>Here&#8217;s a simple example of how you can use this feature.<\/div>\n<div><\/div>\n<div><strong>Step 1 &#8211;<\/strong> Implement <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.iserviceprovider?view=netframework-4.7.2\">IServiceProvider<\/a>. You can implement your own DI logic in it or plug in another DI framework, e.g. <a href=\"https:\/\/github.com\/unitycontainer\/unity\">Unity<\/a>, <a href=\"https:\/\/github.com\/ninject\">Ninject<\/a>. The following example demonstrates injecting an ILog object through the constructor.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/ed3953c7f07dfaa6589eae89e0c289a2.js\"><\/script><\/p>\n<div><\/div>\n<div><strong>Step 2<\/strong> &#8211; Set WebObjectActivator in Global.asax.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/06c20bbd4f4061ac20e04d7bd163a8e7.js\"><\/script><\/p>\n<div><\/div>\n<div><strong>Step 3<\/strong> &#8211; Use Dependency Injection in your Webform page.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/faa6b94326fa429af5d409625685ddde.js\"><\/script><\/p>\n<h2>ASP.NET &#8211; SameSite Cookie<\/h2>\n<div>\n<div><a href=\"https:\/\/tools.ietf.org\/html\/draft-west-first-party-cookies-07\">SameSite prevents the browser<\/a> from sending this cookie along with cross-site requests.\u00a0\u00a0In .NET Framework 4.7.2, a new property <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.web.httpcookie.samesite?view=netframework-4.7.2#System_Web_HttpCookie_SameSite\">SameSite<\/a> has been added in <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.httpcookie?view=netframework-4.7.2\">HttpCookie<\/a> type and ASP.NET will add a SameSite attribute into the set-cookie header if HttpCookie.SameSite is set to SameSiteMode.Strict or SameSiteMode.Lax. The support for SameSite cookie is two-fold in this case:<\/div>\n<ul>\n<li>In <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.httpcookie?view=netframework-4.7.2\">HttpCookie<\/a> object<\/li>\n<li>In <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.security.formsauthentication?view=netframework-4.7.2\">FormsAuthentication<\/a> and <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.sessionstate?view=netframework-4.7.2\">SessionState<\/a> cookies<\/li>\n<\/ul>\n<p>You can set SameSite for a\u00a0<a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.httpcookie?view=netframework-4.7.2\">HttpCookie<\/a> object as follows.<\/p>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/1895b9da4303a448618359ecbbc58f6b.js\"><\/script><\/p>\n<p>You can configure <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.httpcookie?view=netframework-4.7.2\">HttpCookie<\/a> SameSite at application level through web.config as follows.<\/p>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/3505852555fc0e31a9bd07be764a455c.js\"><\/script><\/p>\n<div>You can add SameSite for <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.security.formsauthentication?view=netframework-4.7.2\">FormsAuthentication<\/a>\u00a0and <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.web.sessionstate?view=netframework-4.7.2\">SessionState<\/a>\u00a0cookies through web.config.<\/div>\n<div><\/div>\n<div><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/36c98f6cd8602fe05af01891eefbe586.js\"><\/script><\/div>\n<h2>ClickOnce &#8211; Per-monitor support for WPF and HDPI-aware ClickOnce deployed apps<\/h2>\n<div>\n<div>Earlier WPF developers were unable to deploy applications that specify HDPI settings other than the default <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/mt843498(v=vs.85).aspx\">System Aware<\/a>\u00a0via ClickOnce. When an end user tried to launch this type of application via ClickOnce they were\u00a0unable to run it because of a failure in parsing the ClickOnce manifest.\u00a0Now, with .NET Framework 4.7.2,\u00a0WPF developers can choose ClickOnce deployments when they are using their application manifest to specify new DPI Awareness modes.\u00a0With this feature, users on Windows 10 Spring Creators Update or later will be able to specify latest HDPI settings such as PerMonV2 and launch these applications without any problems.<\/div>\n<div>\n<div>This enables application developers to take advantage of the new HDPI capabilities and can now\u00a0continue to deploy via ClickOnce:<\/div>\n<\/div>\n<div><\/div>\n<\/div>\n<div><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/e75089f4ad4ea143e498d4f20eefa304.js\"><\/script><\/div>\n<div>\n<div><\/div>\n<h2>ClickOnce &#8211; Enable SHA256 timestamping of Deployment Manifests<\/h2>\n<div>\n<div>This feature adds support for using <a href=\"http:\/\/www.rfc-base.org\/rfc-3161.html\">RFC3161 timestamp servers<\/a> (<a href=\"https:\/\/en.wikipedia.org\/wiki\/SHA-2\">SHA256<\/a> based) in timestamping ClickOnce manifests built with <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/tools\/mageui-exe-manifest-generation-and-editing-tool-graphical-client\">Mage.exe<\/a>.\u00a0This enables developers to add industry standard timestamping to their ClickOnce manifests. Developer can now specify RFC3161 timestamp server using the existing Mage argument &#8211;<strong>TimestampUri\u00a0<\/strong>per the following example:<\/div>\n<div><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/b6f86f52547e28298fa11292171b12db.js\"><\/script><\/div>\n<\/div>\n<\/div>\n<h2>SQL &#8211; Azure AD Universal and Multi-factor Authentication Support<\/h2>\n<div>\n<p>Growing compliance and security demand requires many customers to use <a href=\"https:\/\/docs.microsoft.com\/azure\/sql-database\/sql-database-ssms-mfa-authentication\">Multi-Factor authentication (MFA)<\/a>.\u00a0 In addition, current best practices directs developers from not including any user password directly in the connection string. We have extended SqlClient Connection String by introducing a new Azure AD Interactive authentication keyword to support MFA. This also enables support of\u00a0<a href=\"https:\/\/docs.microsoft.com\/azure\/sql-database\/sql-database-aad-authentication-configure\">Azure AD Authentication.<\/a><\/p>\n<p>This feature introduces a new value for the existing \u201cAuthentication\u201d keyword, specifying a new authentication method called \u201cActive Directory Interactive\u201d. The new interactive method supports native and federated Azure AD users as well as Azure AD guest users.\u00a0 When this method is being used, the MFA authentication imposed by Azure AD is supported for SQL DB. In addition, a user password is requested as part of an interactive dialog enabling us to adhere to security best practices.<\/p>\n<p>Originally SQL connectivity in .NET Framework supported only <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.data.sqlclient.sqlauthenticationmethod?view=netframework-4.7.2#System_Data_SqlClient_SqlAuthenticationMethod_ActiveDirectoryPassword\">ActiveDirectoryPassword<\/a> and <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.data.sqlclient.sqlauthenticationmethod?view=netframework-4.7.2#System_Data_SqlClient_SqlAuthenticationMethod_ActiveDirectoryPassword\">ActiveDirectoryIntegrated<\/a>. Both of these are part of the non-interactive <a href=\"https:\/\/docs.microsoft.com\/azure\/active-directory\/develop\/active-directory-authentication-libraries\">ADAL<\/a> protocol which do not support MFA. With the new <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.data.sqlclient.sqlauthenticationmethod?view=netframework-4.7.2#System_Data_SqlClient_SqlAuthenticationMethod_ActiveDirectoryInteractive\"><strong>ActiveDirectoryInteractive <\/strong><\/a>keyword,\u00a0the SQL connectivity supports MFA as well as existing authentication methods (password and integrated authentication) allowing users to enter user password interactively without the need to persist passwords in the SQL connection string.<\/p>\n<p>This feature can be configured with tools like <a href=\"https:\/\/docs.microsoft.com\/sql\/ssdt\/download-sql-server-data-tools-ssdt\">SQL Server Data Tools (SSDT)<\/a>, as illustrated below. In the\u00a0<a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">latest Visual Studio 15.7 preview<\/a>, a new authentication option called \u201cActive Directory Interactive Authentication\u201d can be used to support <a href=\"https:\/\/docs.microsoft.com\/sql\/ssdt\/azure-active-directory\">MFA authentication to SQL database<\/a>.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-17035 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/SSDT.Interactive.png\" alt=\"\" width=\"750\" height=\"676\" \/><\/p>\n<p>The following sample shows how to instantiate the communication provider that is required to register it to a specific authentication method. It also shows creating connections to SQL database using the different authentication methods, of which two are existing ones: ActiveDirectoryPassword, ActiveDirectoryIntegrated and the latest <strong>ActiveDirectoryInteractive.<\/strong><\/p>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/28b5679909a116bb21d3906344a72800.js\"><\/script><\/p>\n<h2>BCL &#8211; Cryptographic Improvements<\/h2>\n<div>\n<h4>New overloads to RSA.Create and DSA.Create<\/h4>\n<div>This simplifies the pattern of creating an <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.rsa?view=netframework-4.7.2\">RSA<\/a> or <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.dsa?view=netframework-4.7.2\">DSA<\/a> object and calling ImportParameters. The &#8216;before&#8217; and &#8216;after&#8217; simplification is illustrated below.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/6d47ad9bd3597c6e4312e6ea77baec0f.js\"><\/script><\/p>\n<div>\n<div>\n<div><span>When generating a new RSA or DSA key with a specific keysize the new size overloads can be utilized.<\/span><\/div>\n<\/div>\n<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/b49eee7aaac4f7662383777d941fb641.js\"><\/script><\/p>\n<div>\n<h4><span>Rfc2898DeriveBytes accepts a hash algorithm name<\/span><\/h4>\n<div>\n<div>\n<p>New constructor overloads have been added to <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.rfc2898derivebytes?view=netframework-4.7.2\">Rfc2898DeriveBytes<\/a>\u00a0that accepts a <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.hashalgorithmname?view=netframework-4.7.2\">HashAlgorithmName<\/a>\u00a0to identify which <a href=\"https:\/\/en.wikipedia.org\/wiki\/HMAC\">HMAC<\/a> algorithm should be used when deriving keys.\u00a0 Developers are encouraged to generate new keys with a <a href=\"https:\/\/en.wikipedia.org\/wiki\/HMAC\">SHA-2<\/a>-based HMAC as follows instead of using\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/HMAC\">HMAC_SHA1.\u00a0<\/a><\/p>\n<p><span><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/edd7ac3dbae6501f3c8a31b278fc749b.js\"><\/script><\/span><\/p>\n<\/div>\n<h4>Support for EphemeralKeySet<\/h4>\n<div><a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.x509certificates.x509contenttype?view=netframework-4.7.2#System_Security_Cryptography_X509Certificates_X509ContentType_Pfx\">PFX<\/a> import can optionally load private keys directly from memory, bypassing the hard drive.\u00a0The <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.x509certificates.x509keystorageflags?view=netframework-4.7.2\">X509KeyStorageFlags<\/a> enumeration has a new member, EphemeralKeySet. When this flag is specified in an X509Certificate2 constructor or X509Certificate2Collection.Import method, the private keys will be loaded as ephemeral keys. This avoids keys being visible on the disk.<\/div>\n<ul>\n<li>Certificates loaded with this flag are not recommended to be added to an X509Store because the keys are not persisted to disk.<\/li>\n<li>\n<div>Keys loaded in this manner will almost always be loaded via <a href=\"https:\/\/msdn.microsoft.com\/library\/windows\/desktop\/bb204775(v=vs.85).aspx\">Windows CNG<\/a>, therefore callers must access the private key via the extension methods &#8211; for e.g., cert.<a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.x509certificates.rsacertificateextensions.getrsaprivatekey?view=netframework-4.7.2#System_Security_Cryptography_X509Certificates_RSACertificateExtensions_GetRSAPrivateKey_System_Security_Cryptography_X509Certificates_X509Certificate2_\">GetRSAPrivateKey<\/a>(). The PrivateKey property on X509Certificate2 will not function.<\/div>\n<\/li>\n<li>\n<div>Since the legacy PrivateKey property will not work with certificates, developers are advised to perform rigorous testing before switching to EphemeralKeySet.<\/div>\n<\/li>\n<\/ul>\n<h4>Programmatic creation of PKCS#10 certification signing requests and X.509 public key certificates<\/h4>\n<p>The .NET Framework now enables generation of\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Certificate_signing_request\">certificate signing requests<\/a> (CSRs), allowing certificate request generation to be staged into existing tooling.<\/p>\n<p>The following example creates a CSR to be valid as a TLS Server Authentication certificate for www.adatum.com. Furthermore, adatum.com is signed with an existing RSA key using RSA-PSS with SHA-2-256.<\/p>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/f6a0bc73889315c447671a0b3100bcbd.js\"><\/script><\/p>\n<p>The .NET Framework now enables workloads to generate self-signed certificates in a programmatic manner. This is frequently useful in test scenarios.<\/p>\n<p>The following example creates a self-signed version of a TLS Server Authentication certificate for www.adatum.com, using an existing ECDSA key with an ECDSA-SHA-2-256 signature.<\/p>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/d7f26dbeb826cba869e00f8aeb8e09cf.js\"><\/script><\/p>\n<h4>Other Features<\/h4>\n<div>\n<ul>\n<li>\n<div>The <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.pkcs.signerinfo?view=netframework-4.7.2\">SignerInfo<\/a> class for SignedCms exposes more information about the signature.\u00a0SignerInfo.SignatureAlgorithm can be queried to determine the signature algorithm used by the signer. <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.pkcs.signerinfo.getsignature?view=netframework-4.7.2#System_Security_Cryptography_Pkcs_SignerInfo_GetSignature\">SignerInfo.GetSignature()<\/a> can be called to get a copy of the cryptographic signature for this signer.<\/div>\n<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.security.cryptography.cryptostream?view=netframework-4.7.2\">CryptoStream<\/a> now has an additional constructor that allows Dispose to not close the wrapped stream.\u00a0To continue with the current behavior, no changes are necessary. To leave the wrapped stream open after the CryptoStream is disposed, use `new <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.cryptostream.-ctor?view=netframework-4.7.2\">CryptoStream<\/a>(stream, transform, mode, leaveOpen: true)`.<\/li>\n<\/ul>\n<h2>BCL &#8211; ZLib decompression support to DeflateStream<\/h2>\n<p>This feature improves the throughput of decompressing ZIP archives by using native implementation of ZIP. This enables up-to 3x increase in the throughput of ZIP archives during decompression. There are minor differences between the existing and native implementation, hence this feature is enabled by default only for applications targeting .NET Framework 4.7.2.\nOlder applications can opt-into this behavior by using the following AppContext switch:\n<script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/04540a3e3551a5282242497145b0197a.js\"><\/script><\/span><\/p>\n<h2>BCL &#8211; Additional Collection APIs<\/h2>\n<div>In .NET Framework 4.7.2 we have added a few APIs to the standard <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.collections?view=netframework-4.7.2\">Collection<\/a> types that will enable new functionality as follows.<\/div>\n<div>\n<div>\n<ul>\n<li>&#8216;<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.collections.generic.hashset-1.trygetvalue?view=netframework-4.7.2#System_Collections_Generic_HashSet_1_TryGetValue__0__0__\">TryGetValue<\/a>&#8216;\u00a0is added to <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.collections.generic.sortedset-1?view=netframework-4.7.2\">SortedSet<\/a> and <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.collections.generic.hashset-1?view=netframework-4.7.2\">HashSet<\/a> to match the Try pattern used in other collection types.<\/li>\n<li>The `Enumerable.To*` extension methods are added to SortedSet and HashSet.<\/li>\n<li>New <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.collections.generic.hashset-1?view=netframework-4.7.2\">HashSet <\/a>constructors allow HashSets to be constructed with a capacity, offering a performance benefit when you know ahead of time what the size of the HashSet will be.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div>The new Collection APIs are listed below.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/dcd1c6db8c3a355e38e6460b5f1877fb.js\"><\/script><\/p>\n<div><\/div>\n<div>\n<h2><\/h2>\n<h2>WorkflowDesigner High Contrast Improvements<\/h2>\n<div>New <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.activities.presentation.workflowdesignercolors?view=netframework-4.7.2\">WorkflowDesignerColors<\/a> have been added to improve UI experiences in high contrast mode.\u00a0The following properties are now added to Class <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.activities.presentation.workflowdesignercolors?view=netframework-4.7.2\">System.Activities.Presentation.WorkflowDesignerColors<\/a>.<\/div>\n<p><script src=\"https:\/\/gist.github.com\/preetikr\/f2505de8f8d1c13df486f9d7cd812bbd.js\"><\/script><\/p>\n<p>Before and after experiences with these changes for various workflow features are illustrated below.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"208\"><strong>Feature<\/strong><\/td>\n<td width=\"208\"><strong>Before<\/strong><\/td>\n<td width=\"208\"><strong>After<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\" width=\"208\">\n<div>\n<div>Foreground colors of selected activities&#8217;s title change to black<\/div>\n<\/div>\n<\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16865 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/03\/HCBlack_ActivityTitle_Before.png\" alt=\"\" width=\"249\" height=\"202\" \/><\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16875 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_ActivityTitle_After.png\" alt=\"\" width=\"261\" height=\"207\" \/><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\" width=\"208\">\n<div>\n<div>Foreground colors of selected arguments\/variables change to black<\/div>\n<\/div>\n<\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16885 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_ArgumentsList_Before-300x59.png\" alt=\"\" width=\"300\" height=\"59\" \/><\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16895 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_ArgumentsList_After-300x56.png\" alt=\"\" width=\"300\" height=\"56\" \/><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\" width=\"208\">\n<div>\n<div>Foreground colors of selected context menu items change to black<\/div>\n<\/div>\n<\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16905 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_ContextMenu_Before-168x300.png\" alt=\"\" width=\"168\" height=\"300\" \/><\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16915 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_ContextMenu_After-159x300.png\" alt=\"\" width=\"159\" height=\"300\" \/><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\" width=\"208\">\n<div>\n<div>Foreground colors of selected flowchart connectors change to turquoise<\/div>\n<\/div>\n<\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16925 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_FlowchartConnectors_Before-300x200.png\" alt=\"\" width=\"300\" height=\"200\" \/><\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16935 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_FlowchartConnectors_After-300x214.png\" alt=\"\" width=\"300\" height=\"214\" \/><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\" width=\"208\">\n<div>\n<div>Foreground colors of selected buttons in properties window change to black<\/div>\n<\/div>\n<\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16945 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_PropertiesButtons_Before-300x137.png\" alt=\"\" width=\"300\" height=\"137\" \/><\/td>\n<td style=\"vertical-align: top;\" width=\"208\"><img decoding=\"async\" class=\"alignnone wp-image-16955 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2018\/04\/HCBlack_PropertiesButtons_After-2-300x150.png\" alt=\"\" width=\"300\" height=\"150\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<\/div>\n<h2><\/h2>\n<h2>WPF &#8211; Finding ResourceDictionaries by Source<\/h2>\n<div>This feature enables a diagnostic assistant to locate the\u00a0<a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.windows.xps.packaging.ixpsfixedpagereader.resourcedictionaries?view=netframework-4.7.2#System_Windows_Xps_Packaging_IXpsFixedPageReader_ResourceDictionaries\">ResourceDictionaries<\/a> that have been created from a given Source Uri.\u00a0A diagnostic assistant such as Visual Studio&#8217;s &#8220;Edit-and-Continue&#8221; facility lets its user edit a ResourceDictionary, with the intent that the changes are applied to the running application. One step in achieving this is finding all the ResourceDictionaries that the running application has created from the dictionary that&#8217;s being edited. For example, an application can declare a ResourceDictionary whose content is copied from a given source URI:<\/div>\n<div><\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/ca46e4e529129f61dd336adb8aaba54d.js\"><\/script><\/p>\n<div>A diagnostic assistant that edits the original markup in &#8220;MyRD.xaml&#8221;\u00a0can use the new feature to locate the dictionary.\u00a0The feature is implemented by a new method on the class\u00a0`<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.windows.diagnostics.resourcedictionarydiagnostics?view=netframework-4.7.2\">System.Windows.Diagnostics.ResourceDictionaryDiagnostics<\/a>` as illustrated by the first line in the code below. The diagnostic assistant would call the new method using an absolute Uri that identifies the original markup as illustrated by the next line below.<\/div>\n<div><\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/2f3cf3ab3c4846f5ade7b7576bfcb44d.js\"><\/script><\/p>\n<div>The feature is for use by diagnostic assistants, not by production\u00a0applications. The method returns an empty enumerable unless\u00a0VisualDiagnostics are enabled and the ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO\u00a0environment variable is set.<\/div>\n<h2>WPF &#8211; Finding ResourceDictionary owners<\/h2>\n<div>This feature enables a diagnostic assistant to locate the\u00a0owners of a given <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.windows.xps.packaging.ixpsfixedpagereader.resourcedictionaries?view=netframework-4.7.2#System_Windows_Xps_Packaging_IXpsFixedPageReader_ResourceDictionaries\">ResourceDictionary<\/a>.\u00a0Whenever a change is made to a ResourceDictionary, WPF automatically finds all DynamicResource references that might be affected by the change. A diagnostic assistant such as Visual Studio&#8217;s &#8220;Edit-and-Continue&#8221; facility may want extend this to handle StaticResource references.<\/div>\n<div>The first step in this process is finding the owners of the dictionary &#8211; all the objects whose `Resources` property refers to the dictionary (either directly, or indirectly via the `ResourceDictionary.MergedDictionaries`property). The new methods support this step.<\/div>\n<div>\n<div>\n<div>The feature is implemented by three new methods on the class\u00a0`System.Windows.DiagnosticsResourceDictionaryDiagnostics`,\u00a0one for each of the base types that have a `Resources` property.<\/div>\n<div><\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/4838d7cb8bfe1dda9761b60beb37670c.js\"><\/script><\/p>\n<div>\n<div>The feature is for use by diagnostic assistants and not by production\u00a0applications. The methods return an empty enumerable unless\u00a0VisualDiagnostics are enabled and the ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO\u00a0environment variable is set.<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<h2>WPF &#8211; Finding StaticResource references<\/h2>\n<div>\n<p>This feature allows a diagnostic assistant to receive a notification\u00a0whenever a StaticResource reference is resolved.\u00a0A diagnostic assistant such as Visual Studio&#8217;s &#8220;Edit-and-Continue&#8221; facility may want to update all uses of a resource when it changes or replaces a value in a\u00a0 <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.windows.xps.packaging.ixpsfixedpagereader.resourcedictionaries?view=netframework-4.7.2#System_Windows_Xps_Packaging_IXpsFixedPageReader_ResourceDictionaries\">ResourceDictionary<\/a>. WPF does this automatically for DynamicResource references, but intentionally does not do so for StaticResource references. The diagnostic assistant is faced with the challenge of locating those uses. This feature helps meet the challenge.<\/p>\n<div>\n<div>The feature is implemented by a new event on the class\u00a0`System.Windows.DiagnosticsResourceDictionaryDiagnostics`.<\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/cb2ad4058db84303bbbd0d206ddac3d0.js\"><\/script><\/p>\n<div><\/div>\n<div>This event is raised whenever the runtime resolves a StaticResource reference.\u00a0The event args describe the resolution, indicating the object and\u00a0property that host the StaticResource reference, and the\u00a0ResourceDictionary and key used for the resolution.<\/div>\n<div><\/div>\n<p><script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/preetikr\/70c8816c54cca6a6fb6e9f787ad520a6.js\"><\/script><\/p>\n<div>The feature is for use by diagnostic assistants, not by production\u00a0applications. The event is not raised (and its `add` method is ignored)\u00a0unless VisualDiagnostics are enabled and the ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO\u00a0environment variable is set.<\/div>\n<\/div>\n<\/div>\n<div>\n<h2><\/h2>\n<h2>Closing<\/h2>\n<p>Please try out these\u00a0<a href=\"https:\/\/github.com\/Microsoft\/dotnet\/blob\/master\/releases\/README.md\">improvements in the .NET Framework<\/a>\u00a0and let us know what you think.\u00a0Please share your feedback in the comments below or on\u00a0<a href=\"https:\/\/github.com\/Microsoft\/dotnet\/issues\/\">GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are happy to announce the release of the\u00a0.NET Framework 4.7.2. It\u2019s included in the\u00a0Windows 10 April 2018 Update. .NET Framework 4.7.2 is also available on Windows 7+ and Windows Server 2008 R2+. You can download the .NET Framework 4.7.2 Web Installer Offline\u00a0Installer The\u00a0.NET Framework 4.7.2\u00a0includes improvements in several areas: [ASP.NET]\u00a0Support for SameSite cookie [&hellip;]<\/p>\n","protected":false},"author":364,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-17125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"acf":[],"blog_post_summary":"<p>Today, we are happy to announce the release of the\u00a0.NET Framework 4.7.2. It\u2019s included in the\u00a0Windows 10 April 2018 Update. .NET Framework 4.7.2 is also available on Windows 7+ and Windows Server 2008 R2+. You can download the .NET Framework 4.7.2 Web Installer Offline\u00a0Installer The\u00a0.NET Framework 4.7.2\u00a0includes improvements in several areas: [ASP.NET]\u00a0Support for SameSite cookie [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/17125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/364"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=17125"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/17125\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=17125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=17125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=17125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}