{"id":37123,"date":"2020-10-13T11:14:17","date_gmt":"2020-10-13T18:14:17","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspnet\/?p=24188"},"modified":"2020-10-13T11:14:17","modified_gmt":"2020-10-13T18:14:17","slug":"asp-net-core-updates-in-net-5-release-candidate-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/asp-net-core-updates-in-net-5-release-candidate-2\/","title":{"rendered":"ASP.NET Core updates in .NET 5 Release Candidate 2"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-5-0-rc-2\/\">.NET 5 Release Candidate 2 (RC2) is now available<\/a> and is ready for evaluation. .NET 5 RC2 is a &#8220;go live&#8221; release, meaning it&#8217;s supported in production. This prerelease of .NET 5 is very close to what we expect to ship for the  .NET 5 release.<\/p>\n<p>Here&#8217;s what&#8217;s new in this RC2 release:<\/p>\n<ul>\n<li>CSS isolation improvements<\/li>\n<li>Blazor WebAssembly debugging improvements<\/li>\n<li>Browser platform compatibility tooling<\/li>\n<\/ul>\n<p>ASP.NET Core in .NET 5 contains lots of great new functionality and improvements! The list below summarizes the many improvements we&#8217;ve made in ASP.NET Core for .NET 5 that you can try out in this release:<\/p>\n<ul>\n<li>MVC &amp; Razor Pages\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#model-binding-and-validation-with-c-9-record-types\">Model binding support for C# 9 record types<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#model-binding-datetime-as-utc\">Model bind <code>DateTime<\/code> as UTC<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#improvements-to-dynamicroutevaluetransformer\">Improvements to <code>DynamicRouteValueTransformer<\/code><\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#other-improvements\">Apply <code>CompareAttribute<\/code> to page model properties<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#other-improvements\">Parameters and properties bound from the body are now required by default<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Web API\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#open-api-specification-on-by-default\">Open API specification support on-by-default<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#better-f5-experience-for-web-api-projects\">Improved F5 experience with Swagger UI<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Blazor\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#css-isolation-for-blazor-components\">CSS isolation<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/blazor\/call-javascript-from-dotnet?view=aspnetcore-5.0#blazor-javascript-isolation-and-object-references\">JavaScript isolation and object references<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/blazor\/components\/virtualization\">Component virtualization<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/blazor\/file-uploads\">New <code>InputFile<\/code> component<\/a> <\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/blazor\/forms-validation?view=aspnetcore-5.0#radio-buttons\">New <code>InputRadio<\/code> and <code>InputRadioGroup<\/code> components<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#custom-validation-class-attributes-in-blazor\">Custom validation class attributes<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#iasyncdisposable-support-for-blazor-components\"><code>IAsyncDisposable<\/code> support for components<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#blazor-support-for-ontoggle-event\">Support for toggle events<\/a><\/li>\n<li>Added <code>OffsetX<\/code> and <code>OffsetY<\/code> properties to <code>MouseEventArgs<\/code><\/li>\n<li>Optional and catch-all route parameters<\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#blazor-webassembly-apps-now-target-net-5\">Blazor WebAssembly apps now target .NET 5<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#blazor-webassembly-performance-improvements\">Blazor WebAssembly runtime performance improvements<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/blazor\/webassembly-lazy-load-assemblies\">Blazor WebAssembly support for lazy loading<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#blazor-webassembly-prerendering\">Blazor WebAssembly server-side prerendering<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#set-ui-focus-in-blazor-apps\">Blazor support for setting the UI focus<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#protected-browser-storage\">Blazor Server protected browser storage<\/a><\/li>\n<\/ul>\n<\/li>\n<li>SignalR\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/signalr\/hub-filters\">Hub filters<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#signalr-parallel-hub-invocations\">Parallel hub invocations<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#added-messagepack-support-in-signalr-java-client\">Messagepack support in SignalR Java client<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Kestrel\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#sending-http-2-ping-frames\">Send HTTP\/2 PING frames<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-4\/#performance-improvements-to-http-2\">HTTP\/2 performance improvements<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#kestrel-endpoint-specific-options-via-configuration\">Kestrel endpoint-specific options via configuration<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-5\/#reloadable-endpoints-via-configuration-for-kestrel\">Reloadable endpoints via configuration<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#custom-header-decoding-in-kestrel\">Custom header decoding<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/20981\">Support for async certificate callbacks<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Authentication &amp; authorization\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#azure-active-directory-authentication-with-microsoft-identity-web\">Azure AD authentication with Microsoft.Identity.Web<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-6\/#extension-method-to-allow-anonymous-access-to-an-endpoint\">Extension method to allow anonymous access to an endpoint<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/security\/authentication\/windowsauth?view=aspnetcore-5.0\">RBAC authorization with Kerberos authentication and LDAP on Linux<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-6\/#custom-handling-of-authorization-failures\">Custom handling of authorization failures<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-release-candidate-1\/#control-startup-class-activation\">Control <code>Startup<\/code> class activation<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#console-logger-formatter\">Custom console logging formatter<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#auto-refresh-with-dotnet-watch\">JSON console logger<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-7\/#other-improvements\">Nullability annotations applied to all ASP.NET Core assemblies<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-6\/#json-extension-methods-for-httprequest-and-httpresponse\">JSON extension methods for <code>HttpRequest<\/code> and <code>HttpResponse<\/code><\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/asp-net-core-updates-in-net-5-preview-8\/#auto-refresh-with-dotnet-watch\">Auto browser refresh with <code>dotnet watch<\/code><\/a><\/li>\n<\/ul>\n<p>See the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/release-notes\/5.0\">.NET 5 release notes<\/a> for additional details and known issues.<\/p>\n<h2>Get started<\/h2>\n<p>To get started with ASP.NET Core in .NET 5 RC2, <a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet-core\/5.0\">install the .NET 5 SDK<\/a>. .NET RC2 also is included with Visual Studio 2019 16.8 Preview 4.<\/p>\n<p><a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Visual Studio 2019 16.8 Preview 4<\/a> or later is required to use .NET 5 RC2 from Visual Studio. .NET 5 RC2 is also supported with the latest <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/mac\/install-preview\">preview<\/a> of <a href=\"https:\/\/visualstudio.microsoft.com\/\">Visual Studio for Mac<\/a>. To use .NET 5 with <a href=\"https:\/\/visualstudio.microsoft.com\/\">Visual Studio Code<\/a>, install the latest version of the <a href=\"https:\/\/code.visualstudio.com\/Docs\/languages\/csharp\">C# extension<\/a>.<\/p>\n<h2>Upgrade an existing project<\/h2>\n<p>To upgrade an existing ASP.NET Core app from .NET 5 RC1 to .NET 5 RC2:<\/p>\n<ul>\n<li>Update all Microsoft.AspNetCore.&#042; package references to <code>5.0.0-rc.2.*<\/code>.<\/li>\n<li>Update all Microsoft.Extensions.&#042; package references to <code>5.0.0-rc.2.*<\/code>.<\/li>\n<li>Update System.Net.Http.Json package references to <code>5.0.0-rc.2.*<\/code>.<\/li>\n<li>Update Microsoft.AspNetCore.Components.Web.Extensions package references to <code>5.0.0-preview9.20513.1<\/code>.<\/li>\n<li>Remove any package references to Microsoft.AspNetCore.Components.ProtectedBrowserStorage<\/li>\n<li>Update <code>Microsoft.AspNetCore.Components.ProtectedBrowserStorage<\/code> namespace to <code>Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage<\/code>.<\/li>\n<li>Remove unnecessary service registrations for <code>ProtectedLocalStorage<\/code> and <code>ProtectedSessionStorage<\/code>.<\/li>\n<li>Rename <code>JSObjectReference<\/code> to <code>IJSObjectReference<\/code>.<\/li>\n<li>In Blazor apps, replace CSS references to <em>_framework\/scoped.styles.css<\/em> and <em>_content\/{project_name}\/_framework\/scoped.styles.css<\/em> with <em>{project_name}.styles.css<\/em>.<\/li>\n<\/ul>\n<p>That&#8217;s it! You should be all ready to go.<\/p>\n<p>See also the full list of <a href=\"https:\/\/github.com\/aspnet\/announcements\/issues?q=is%3Aopen+is%3Aissue+milestone%3A5.0+label%3A%22Breaking+change%22\">breaking changes<\/a> in ASP.NET Core for .NET 5.<\/p>\n<h2>What&#8217;s new?<\/h2>\n<h3>Blazor CSS isolation improvements<\/h3>\n<p>In .NET 5 Preview 8 we introduced support for CSS isolation for Blazor components. Based on user feedback, we&#8217;ve made a number of improvements to CSS isolation in this release.<\/p>\n<p>Previously, all component scoped CSS files including files from referenced projects or packages were compiled into a single bundle, <em>scoped.styles.css<\/em>. We now produce one bundle per referenced project or package and include those bundles into the app bundle through CSS <code>@import<\/code> statements.<\/p>\n<p>The bundle names are now based on the project names: <em>{project_name}.styles.css<\/em>. Each bundle can be referenced from the root path of the app by default. This makes the path of the app bundle the same for both Blazor Server and Blazor WebAssembly projects:<\/p>\n<pre><code class=\"html\">&lt;link href=\"BlazorApp1.styles.css\" rel=\"stylesheet\" \/&gt;\n<\/code><\/pre>\n<p>Component specific styles can also now use normal <code>wwwroot<\/code>-relative paths to refer to related assets, like images. We&#8217;ve updated Razor Class Library template to make use of component specific styles following this pattern.<\/p>\n<p><em>Component1.razor.css<\/em><\/p>\n<pre><code class=\"css\">.my-component {\n    border: 2px dashed red;\n    padding: 1em;\n    margin: 1em 0;\n    background-image: url('background.png');\n}\n<\/code><\/pre>\n<p>We also fixed some issues with how scoped CSS styles get built so that changes are correctly picked up with each build in Visual Studio instead of requiring a full rebuild.<\/p>\n<h3>Blazor WebAssembly debugging improvements<\/h3>\n<p>.NET 5 includes a variety of improvements to Blazor WebAssembly debugging:<\/p>\n<ul>\n<li>Various reliability improvements, including fixing the <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/25887\">port conflict issue<\/a> from RC1<\/li>\n<li>Improved support for stepping over and out of async methods<\/li>\n<li>Inspect locals or object properties in many previously unsupported situations:\n<ul>\n<li>For inherited members<\/li>\n<li>For multicast delegates<\/li>\n<li>For boxed values<\/li>\n<li>For <code>Nullable&lt;T&gt;<\/code> values<\/li>\n<li>Within reflection based calls<\/li>\n<\/ul>\n<\/li>\n<li>Support for debugging lazy loaded assemblies<\/li>\n<\/ul>\n<h3>Browser platform compatibility tooling<\/h3>\n<p>The core framework libraries in .NET 5 have now been annotated to indicate which APIs are supported in browser scenarios. The platform compatibility analyzer uses this data to give appropriate warnings when using APIs from a Blazor WebAssembly app that are not supported when running in a browser on WebAssembly.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2020\/10\/browser-compatibility.png\" alt=\"Browser compatibility check\" \/><\/p>\n<p>Learn more about how you can use the new platform compatibility analyzer to <a href=\"https:\/\/docs.microsoft.com\/dotnet\/standard\/analyzers\/api-analyzer#discover-cross-platform-issues\">discover cross-platform compatibility issues<\/a>.<\/p>\n<h2>Give feedback<\/h2>\n<p>We hope you enjoy this release of ASP.NET Core in .NET 5! We are eager to hear about your experiences with this latest .NET 5 release. Let us know what you think by filing issues on <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\">GitHub<\/a>.<\/p>\n<p>Thanks for trying out ASP.NET Core!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET 5 Release Candidate 2 is now available! Check out all the improvements in ASP.NET Core in this update.<\/p>\n","protected":false},"author":417,"featured_media":21373,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,7509,7251],"tags":[],"class_list":["post-37123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","category-aspnetcore","category-blazor"],"acf":[],"blog_post_summary":"<p>.NET 5 Release Candidate 2 is now available! Check out all the improvements in ASP.NET Core in this update.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/37123","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\/417"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=37123"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/37123\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/21373"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=37123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=37123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=37123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}