09-07-2023, 10:28 AM
ASP.NET Core updates in .NET 5 Release Candidate 2
<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.jpg" width="150" height="150" title="" alt="" /></div><div><div class="row justify-content-center">
<div class="col-md-4">
<div><img decoding="async" loading="lazy" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.jpg" width="58" height="58" alt="Daniel Roth" class="avatar avatar-58 wp-user-avatar wp-user-avatar-58 alignnone photo"></p>
<p>Daniel</p>
</div>
</div>
</div>
<div class="entry-meta entry-meta-layout">
<p>October 13th, 2020</p>
</p></div>
<p><!-- .entry-meta --> </p>
<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 “go live” release, meaning it’s supported in production. This prerelease of .NET 5 is very close to what we expect to ship for the .NET 5 release.</p>
<p>Here’s what’s new in this RC2 release:</p>
<ul>
<li>CSS isolation improvements</li>
<li>Blazor WebAssembly debugging improvements</li>
<li>Browser platform compatibility tooling</li>
</ul>
<p>ASP.NET Core in .NET 5 contains lots of great new functionality and improvements! The list below summarizes the many improvements we’ve made in ASP.NET Core for .NET 5 that you can try out in this release:</p>
<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>
<h2 id="get-started">Get started</h2>
<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>
<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>
<h2 id="upgrade-an-existing-project">Upgrade an existing project</h2>
<p>To upgrade an existing ASP.NET Core app from .NET 5 RC1 to .NET 5 RC2:</p>
<ul>
<li>Update all Microsoft.AspNetCore.* package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update all Microsoft.Extensions.* package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update System.Net.Http.Json package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update Microsoft.AspNetCore.Components.Web.Extensions package references to <code>5.0.0-preview9.20513.1</code>.</li>
<li>Remove any package references to Microsoft.AspNetCore.Components.ProtectedBrowserStorage</li>
<li>Update <code>Microsoft.AspNetCore.Components.ProtectedBrowserStorage</code> namespace to <code>Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage</code>.</li>
<li>Remove unnecessary service registrations for <code>ProtectedLocalStorage</code> and <code>ProtectedSessionStorage</code>.</li>
<li>Rename <code>JSObjectReference</code> to <code>IJSObjectReference</code>.</li>
<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>
</ul>
<p>That’s it! You should be all ready to go.</p>
<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>
<h2 id="whats-new">What’s new?</h2>
<h3 id="blazor-css-isolation-improvements">Blazor CSS isolation improvements</h3>
<p>In .NET 5 Preview 8 we introduced support for CSS isolation for Blazor components. Based on user feedback, we’ve made a number of improvements to CSS isolation in this release.</p>
<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>
<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>
<pre><code class="html"><link href="BlazorApp1.styles.css" rel="stylesheet" />
</code></pre>
<p>Component specific styles can also now use normal <code>wwwroot</code>-relative paths to refer to related assets, like images. We’ve updated Razor Class Library template to make use of component specific styles following this pattern.</p>
<p><em>Component1.razor.css</em></p>
<pre><code class="css">.my-component { border: 2px dashed red; padding: 1em; margin: 1em 0; background-image: url('background.png');
}
</code></pre>
<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>
<h3 id="blazor-webassembly-debugging-improvements">Blazor WebAssembly debugging improvements</h3>
<p>.NET 5 includes a variety of improvements to Blazor WebAssembly debugging:</p>
<ul>
<li>Various reliability improvements, including fixing the <a href="https://github.com/dotnet/aspnetcore/issues/25887">port conflict issue</a> from RC1</li>
<li>Improved support for stepping over and out of async methods</li>
<li>Inspect locals or object properties in many previously unsupported situations:
<ul>
<li>For inherited members</li>
<li>For multicast delegates</li>
<li>For boxed values</li>
<li>For <code>Nullable<T></code> values</li>
<li>Within reflection based calls</li>
</ul>
</li>
<li>Support for debugging lazy loaded assemblies</li>
</ul>
<h3 id="browser-platform-compatibility-tooling">Browser platform compatibility tooling</h3>
<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>
<p><img decoding="async" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.png" alt="Browser compatibility check"></p>
<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>
<h2 id="give-feedback">Give feedback</h2>
<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>
<p>Thanks for trying out ASP.NET Core!</p>
</div>
https://www.sickgaming.net/blog/2020/10/...ndidate-2/
<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.jpg" width="150" height="150" title="" alt="" /></div><div><div class="row justify-content-center">
<div class="col-md-4">
<div><img decoding="async" loading="lazy" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.jpg" width="58" height="58" alt="Daniel Roth" class="avatar avatar-58 wp-user-avatar wp-user-avatar-58 alignnone photo"></p>
<p>Daniel</p>
</div>
</div>
</div>
<div class="entry-meta entry-meta-layout">
<p>October 13th, 2020</p>
</p></div>
<p><!-- .entry-meta --> </p>
<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 “go live” release, meaning it’s supported in production. This prerelease of .NET 5 is very close to what we expect to ship for the .NET 5 release.</p>
<p>Here’s what’s new in this RC2 release:</p>
<ul>
<li>CSS isolation improvements</li>
<li>Blazor WebAssembly debugging improvements</li>
<li>Browser platform compatibility tooling</li>
</ul>
<p>ASP.NET Core in .NET 5 contains lots of great new functionality and improvements! The list below summarizes the many improvements we’ve made in ASP.NET Core for .NET 5 that you can try out in this release:</p>
<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>
<h2 id="get-started">Get started</h2>
<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>
<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>
<h2 id="upgrade-an-existing-project">Upgrade an existing project</h2>
<p>To upgrade an existing ASP.NET Core app from .NET 5 RC1 to .NET 5 RC2:</p>
<ul>
<li>Update all Microsoft.AspNetCore.* package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update all Microsoft.Extensions.* package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update System.Net.Http.Json package references to <code>5.0.0-rc.2.*</code>.</li>
<li>Update Microsoft.AspNetCore.Components.Web.Extensions package references to <code>5.0.0-preview9.20513.1</code>.</li>
<li>Remove any package references to Microsoft.AspNetCore.Components.ProtectedBrowserStorage</li>
<li>Update <code>Microsoft.AspNetCore.Components.ProtectedBrowserStorage</code> namespace to <code>Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage</code>.</li>
<li>Remove unnecessary service registrations for <code>ProtectedLocalStorage</code> and <code>ProtectedSessionStorage</code>.</li>
<li>Rename <code>JSObjectReference</code> to <code>IJSObjectReference</code>.</li>
<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>
</ul>
<p>That’s it! You should be all ready to go.</p>
<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>
<h2 id="whats-new">What’s new?</h2>
<h3 id="blazor-css-isolation-improvements">Blazor CSS isolation improvements</h3>
<p>In .NET 5 Preview 8 we introduced support for CSS isolation for Blazor components. Based on user feedback, we’ve made a number of improvements to CSS isolation in this release.</p>
<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>
<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>
<pre><code class="html"><link href="BlazorApp1.styles.css" rel="stylesheet" />
</code></pre>
<p>Component specific styles can also now use normal <code>wwwroot</code>-relative paths to refer to related assets, like images. We’ve updated Razor Class Library template to make use of component specific styles following this pattern.</p>
<p><em>Component1.razor.css</em></p>
<pre><code class="css">.my-component { border: 2px dashed red; padding: 1em; margin: 1em 0; background-image: url('background.png');
}
</code></pre>
<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>
<h3 id="blazor-webassembly-debugging-improvements">Blazor WebAssembly debugging improvements</h3>
<p>.NET 5 includes a variety of improvements to Blazor WebAssembly debugging:</p>
<ul>
<li>Various reliability improvements, including fixing the <a href="https://github.com/dotnet/aspnetcore/issues/25887">port conflict issue</a> from RC1</li>
<li>Improved support for stepping over and out of async methods</li>
<li>Inspect locals or object properties in many previously unsupported situations:
<ul>
<li>For inherited members</li>
<li>For multicast delegates</li>
<li>For boxed values</li>
<li>For <code>Nullable<T></code> values</li>
<li>Within reflection based calls</li>
</ul>
</li>
<li>Support for debugging lazy loaded assemblies</li>
</ul>
<h3 id="browser-platform-compatibility-tooling">Browser platform compatibility tooling</h3>
<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>
<p><img decoding="async" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/10/asp-net-core-updates-in-net-5-release-candidate-2.png" alt="Browser compatibility check"></p>
<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>
<h2 id="give-feedback">Give feedback</h2>
<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>
<p>Thanks for trying out ASP.NET Core!</p>
</div>
https://www.sickgaming.net/blog/2020/10/...ndidate-2/