{"id":33571,"date":"2021-07-14T09:30:39","date_gmt":"2021-07-14T16:30:39","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=33571"},"modified":"2021-07-14T10:12:30","modified_gmt":"2021-07-14T17:12:30","slug":"announcing-net-6-preview-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-6-preview-6\/","title":{"rendered":"Announcing .NET 6 Preview 6"},"content":{"rendered":"<p>We are happy to release .NET 6 Preview 6. Preview 6 is the second to last preview before we enter the RC period. There will be two RCs. This release itself is relatively small, while Preview 7 will be bigger. After that, we&#8217;re down to quality fixes until the final release in November. We&#8217;re looking forward to a great new .NET release.<\/p>\n<p>You can <a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet\/6.0\">download .NET 6 Preview 6<\/a> for Linux, macOS, and Windows.<\/p>\n<ul>\n<li><a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet\/6.0\">Installers and binaries<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/_\/microsoft-dotnet\">Container images<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/6.0\/install-linux.md\">Linux packages<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/6.0\/README.md\">Release notes<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/core\/tree\/main\/release-notes\/6.0\/preview\/api-diff\/preview6\">API diff<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/6.0\/known-issues.md\">Known issues<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/core\/issues\/6467\">GitHub issue tracker<\/a><\/li>\n<\/ul>\n<p>See the <a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-6-preview-6\/\">ASP.NET Core<\/a>, <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-entity-framework-core-6-0-preview-6-configure-conventions\/\">EF Core<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-maui-preview-6\/\">.NET MAUI<\/a> posts for more detail on what\u2019s new for web, data access, and client scenarios.<\/p>\n<p>Starting with .NET 6 Preview 6, we&#8217;ve tested and support <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/releases\/2022\/release-notes-preview#17.0.0-pre.2.0\">Visual Studio 2022 Preview 2<\/a>. <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/vs2022\/\">Visual Studio 2022<\/a> enables you to leverage the Visual Studio tools developed for .NET 6 such as development in .NET MAUI, Hot Reload for C# apps, new Web Live Preview for WebForms, and other performance improvements in your IDE experience. .NET 6 has also been tested with <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/mac\/\">Visual Studio for Mac 8.9<\/a>.<\/p>\n<p>Check out the new <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/category\/conversations\/\">conversations posts<\/a> for in-depth engineer-to-engineer discussions of the latest .NET features.<\/p>\n<h2>x64 emulation update<\/h2>\n<p>We&#8217;re done adding support for Apple Silicon for macOS and Arm64 for Windows. What&#8217;s left is <a href=\"https:\/\/github.com\/dotnet\/designs\/pull\/217\">supporting x64 emulation<\/a> on <a href=\"https:\/\/support.apple.com\/HT211861\">macOS Apple Silicon<\/a> and <a href=\"https:\/\/blogs.windows.com\/windows-insider\/2020\/12\/10\/introducing-x64-emulation-in-preview-for-windows-10-on-arm-pcs-to-the-windows-insider-program\/\">Windows Arm64<\/a>. We need to do two things to enable that.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dotnet\/designs\/pull\/217\">Side-by-side capable installers<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/designs\/pull\/233\">First-class architecture targeting with the .NET CLI<\/a> to (primarily) enable using the native architecture SDK in all scenarios.<\/li>\n<\/ul>\n<p>Until side-by-side capable installers are available (later in .NET 6), you&#8217;ll either need to install all x64 builds or all Arm64 ones. If you want to switch, you need to uninstall\/delete all .NET versions on your Arm64 machine. That&#8217;s unfortunate, but where we are at at this point.<\/p>\n<h2>Tools: .NET SDK Optional Workload improvements<\/h2>\n<p>We have added three new <a href=\"https:\/\/github.com\/dotnet\/designs\/blob\/main\/accepted\/2020\/workloads\/workloads.md\">workload<\/a> commands that enable better discovery and management.<\/p>\n<ul>\n<li><code>dotnet workload search<\/code> &#8212; list workloads available to install.<\/li>\n<li><code>dotnet workload uninstall<\/code> &#8212; remove the specified workload if you no longer require a workload. Also a good option for space saving.<\/li>\n<li><code>dotnet workload repair<\/code> &#8212; re-install all workloads you&#8217;ve previously installed.\n<ul>\n<li>This is useful if your install fails in the middle because of a dropped internet connection.<\/li>\n<li>Optional workloads are made up of multiple workload packs and you may have gotten into a state where some installed successfully but others didn&#8217;t.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>In previous previews, we added the following commands:<\/p>\n<ul>\n<li><code>dotnet workload install<\/code> &#8212; installs a workload.<\/li>\n<li><code>dotnet workload list<\/code> &#8212; lists installed workloads.<\/li>\n<li><code>dotnet workload update<\/code> &#8212; updates installed workloads.<\/li>\n<\/ul>\n<h2>Libraries: TLS support for <code>System.DirectoryServices.Protocols<\/code><\/h2>\n<p><a href=\"https:\/\/github.com\/dotnet\/runtime\/pull\/52904\">TLS support has been enabled<\/a> for <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/system.directoryservices.protocols\"><code>System.DirectoryServices.Protocols<\/code><\/a> for Linux and macOS. It was already enabled for Windows. .NET users can now enjoy secure communications with LDAP servers.<\/p>\n<p>Credit to <a href=\"https:\/\/github.com\/iinuwa\">@iinuwa<\/a>.<\/p>\n<h2>Tools: Crossgen2 replaces crossgen<\/h2>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/conversation-about-crossgen2\/\">Crossgen2<\/a> has been enabled for all existing crossgen scenarios. With that milestone behind us, we&#8217;ve also removed (the old) crossgen from the SDK. It is no longer accessible and cannot be used.<\/p>\n<p>Crossgen (1 and 2) enables pre-compiling IL to native code as a publishing step. Pre-compilation is primarily beneficial for improving startup. Crossgen2 is a from-scratch implementation that is already proving to be a superior platform for code generation innovation. For example, crossgen2 can generate code for a broader set of IL patterns than crossgen1.<\/p>\n<p>The following MSBuild properties demonstrate how to enable pre-compilation with crossgen2.<\/p>\n<pre><code class=\"language-xml\">      &lt;!-- Enable pre-compiling native code (in ready-to-run format) with crossgen2 --&gt;\r\n      &lt;PublishReadyToRun&gt;true&lt;\/PublishReadyToRun&gt; \r\n      &lt;!-- Enable generating a composite R2R image --&gt;\r\n      &lt;PublishReadyToRunComposite&gt;true&lt;\/PublishReadyToRunComposite&gt;<\/code><\/pre>\n<h2>Libraries: Improved sync-over-async performance<\/h2>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/should-i-expose-synchronous-wrappers-for-asynchronous-methods\/\">Sync-over-async<\/a> is a common type of blocking work. It can lead to starvation when it happens on thread pool worker threads. Slow thread injection may delay other queued work from running, and may delay the starvation from being resolved.<\/p>\n<p>This <a href=\"https:\/\/github.com\/dotnet\/runtime\/pull\/53471\">change<\/a> improved the rate of thread injection by default when sync-over-async is the only type of blocking work happening on thread pool worker threads. There are some <a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/a7a2fd6543ff71cecbbfe901b81ee27a6cf428c0\/src\/libraries\/System.Private.CoreLib\/src\/System\/Threading\/PortableThreadPool.Blocking.cs#L271-L314\">new <code>AppContext<\/code> config values<\/a> that can be used to configure the rate of thread injection in response to sync-over-async.<\/p>\n<h2>Runtime: W^X memory policy<\/h2>\n<p>We are <a href=\"https:\/\/github.com\/dotnet\/runtime\/issues\/50391\">enabling support<\/a> for <a href=\"https:\/\/github.com\/dotnet\/designs\/blob\/main\/accepted\/2021\/runtime-security-mitigations.md#wx\">W^X memory protection<\/a>. It is a requirement on Apple Silicon machines and a useful security measure on other operating systems.<\/p>\n<p>This feature has an abnormal name. It should be read as &#8220;write exclusive execute&#8221;. That means that a memory page can be marked for read\/write or read\/execute but never any combination that includes write and execute. Write\/execute pages are subject to being exploited with buffer overrun attacks, for example.<\/p>\n<p>This feature requires changes throughout the product, wherever write\/execute pages are used. For example, preview 6 includes a change that requires the <a href=\"https:\/\/github.com\/dotnet\/runtime\/pull\/53173\">JIT to cooperate with the W^X scheme we&#8217;ve adopted<\/a>.<\/p>\n<p>W^X is a requirement of macOS on Apple Silicon machines, optional in all other environments for .NET 6 and will likely be the default mode in all environments for .NET 7.<\/p>\n<p>Note: The W^X implementation has a startup regression with .NET 6 on all environments but Apple Silicon. It will be resolved as part of .NET 7. The Apple Silicon implementation has no such regression due to <a href=\"https:\/\/developer.apple.com\/documentation\/apple-silicon\/porting-just-in-time-compilers-to-apple-silicon\">operating system support for this scenario<\/a>.<\/p>\n<h2>CodeGen changelog<\/h2>\n<p>The following codegen changes are included in Preview 6.<\/p>\n<h3>Dynamic PGO<\/h3>\n<ul>\n<li>Add option to choose guarded devirt class randomly https:\/\/github.com\/dotnet\/runtime\/pull\/53399<\/li>\n<li>pgo\/devirt diagnostic improvements https:\/\/github.com\/dotnet\/runtime\/pull\/53247<\/li>\n<\/ul>\n<h3>LSRA<\/h3>\n<ul>\n<li>Refactor <a href=\"https:\/\/github.com\/dotnet\/runtime\/blob\/main\/docs\/design\/coreclr\/jit\/lsra-detail.md\">LSRA<\/a> heuristics selection https:\/\/github.com\/dotnet\/runtime\/pull\/52832\n<ul>\n<li>Now, DEBUG mode includes a COMPlus variable that LsraOrdering will let the user set the heuristics ordering.<\/li>\n<li>Tune the heuristics for register to select optimal register candidate to spill. https:\/\/github.com\/dotnet\/runtime\/pull\/53853<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The following improvements are based on these changes.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/63486087\/124963432-a6d57580-dfd4-11eb-9549-e7d5a8231448.png\" alt=\"image\" \/>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/63486087\/124963446-ac32c000-dfd4-11eb-9960-69832b72f7b2.png\" alt=\"image\" \/>\n<img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/63486087\/124963455-b05edd80-dfd4-11eb-82a0-06de64fcc3f9.png\" alt=\"image\" \/><\/p>\n<p>More improvements:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/DrewScoggins\/performance-2\/issues\/6612\">Windows x86<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/DrewScoggins\/performance-2\/issues\/6592\">Windows x64<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/DrewScoggins\/performance-2\/issues\/6593\">General<\/a><\/li>\n<\/ul>\n<h3>Code quality<\/h3>\n<ul>\n<li>Eliminate redundant \u201ctest\u201d instruction https:\/\/github.com\/dotnet\/runtime\/pull\/53214<\/li>\n<\/ul>\n<h2>Closing<\/h2>\n<p>The release is quickly coming together and to an end. We&#8217;ll soon be addressing only the most pressing feedback, approaching the same bug bar that we use for servicing releases. If you&#8217;ve been holding on to some feedback or have yet to try .NET 6, please do now. It&#8217;s your last chance to influence the release.<\/p>\n<p>Thanks for everyone who has contributed to making .NET 6 another great release.<\/p>\n<p>Thanks for being a .NET developer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET 6 Preview 6 is now available.<\/p>\n","protected":false},"author":1312,"featured_media":21638,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,196],"tags":[],"class_list":["post-33571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-dotnet-core"],"acf":[],"blog_post_summary":"<p>.NET 6 Preview 6 is now available.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/33571","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\/1312"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=33571"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/33571\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/21638"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=33571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=33571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=33571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}