ASP.NET Core and Blazor updates in .NET Core 3.0

Daniel
ASP.NET Core and Blazor updates in .NET Core 3.0
Today we are thrilled to announce the release of .NET Core 3.0! .NET Core 3.0 is ready for production use, and is loaded with lots of great new features for building amazing web apps with ASP.NET Core and Blazor.
Some of the big new features in this release of ASP.NET Core include:
- Build rich interactive client-side web apps using C# instead of JavaScript using Blazor).
- Create high-performance backend services with gRPC.
- SignalR now has support for automatic reconnection and client-to-server streaming.
- Generate strongly typed client code for Web APIs with OpenAPI documents.
- Endpoint routing integrated through the framework.
- HTTP/2 now enabled by default in Kestrel.
- Authentication support for Web APIs and single-page apps integrated with IdentityServer
- Support for certificate and Kerberos authentication.
- Integrates with the new System.Text.Json serializer.
- New generic host sets up common hosting services like dependency injection (DI), configuration, and logging.
- New Worker Service template for building long-running services.
- New EventCounters created for requests per second, total requests, current requests, and failed requests.
- Startup errors now reported to the Windows Event Log when hosted in IIS.
- Request pipeline integrated with with System.IO.Pipelines.
- Performance improvements across the entire stack.
You can find all the details about what’s new in ASP.NET Core in .NET Core 3.0 in the What’s new in ASP.NET Core 3.0 topic.
See the .NET Core 3.0 release notes for additional details and known issues.
Get started
To get started with ASP.NET Core in .NET Core 3.0 install the .NET Core 3.0 SDK.
If you’re on Windows using Visual Studio, install Visual Studio 2019 16.3, which includes .NET Core 3.0.
Note: .NET Core 3.0 requires Visual Studio 2019 16.3 or later.
There is also a Blazor WebAssembly preview update available with this release. This update to Blazor WebAssembly still has a Preview 9 version, but carries an updated build number. Blazor WebAssembly is still in preview and is not part of the .NET Core 3.0 release.
To install the latest Blazor WebAssembly template run the following command:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview9.19465.2
Upgrade an existing project
To upgrade an existing ASP.NET Core app to .NET Core 3.0, follow the migrations steps in the ASP.NET Core docs.
See the full list of breaking changes in ASP.NET Core 3.0.
To upgrade an existing ASP.NET Core 3.0 RC1 project to 3.0:
- Update all Microsoft.AspNetCore.* and Microsoft.Extensions.* package references to 3.0.0
- Update all Microsoft.AspNetCore.Blazor.* package references to 3.0.0-preview9.19465.2
That’s it! You should now be all set to use .NET Core 3.0!
Join us at .NET Conf!
Please join us at .NET Conf to learn all about the new features in .NET Core 3.0 and to celebrate the release with us! .NET Conf is a live streaming event open to everyone, and features talks from many talented speakers from the .NET team and the .NET community. Check out the schedule and attend a local event near you. Or join the Virtual Attendee Party for the chance to win prizes!
Give feedback
We hope you enjoy the new features in this release of ASP.NET Core and Blazor in .NET Core 3.0! We are eager to hear about your experiences with this latest .NET Core release. Let us know what you think by filing issues on GitHub.
Thanks for using ASP.NET Core and Blazor!
44 comments
Awesome! It has been a fun ride up to this point. May the fun continue. Thanks Dan!
Nice! But are the package versions for Blazor correct?
Yes, I believe so. The Blazor WebAssembly packages are still in preview, so they have a preview9 based version number. If your hitting issues with packages versions let us know!
Good work. Looking forward for production ready client side Blazor.
+1 this
We are also looking forward to production ready client-side Blazor.
I believe the slides that Scott Hunter referred to in his .NET Conf Keynote showed a WebAssembly milestone scheduled for May 2020 so I guess we may see a client-side Blazor update around then.
Yes, we are now planning to ship Blazor WebAssembly in May of next year. Wohoo!
Will it have authentication and authorization?
See https://docs.microsoft.com/aspnet/core/security/blazor/ for info on Authentication and Authorization in Blazor WebAssembly apps. We are also looking at enabling the various authentication template options for Blazor WebAssembly.
Super news, another milestone!
I checked the release notes, but if I have VS 19 16.0.1 and VS 19 16.3.2 Preview 2, what should I do regarding installing/uninstalling .NET Core SDKs and the latest VS?
There are 3 aspects to this:
I haven’t been able to reference the correct Blazor client side templates since Feb ’19 (.NET Preview 2?). Is there a way of properly removing SDK references? Some strange things going on there even after trying to remove from the command line;
I’m pretty sure I should be able to see a message in my current (non preview) VS 19, telling me 16.3 is available. Alas nothing. Will I get a notification and I can just over-install?;
what is the situation regarding VS Preview – can it be completely uninstalled or is it a test platform moving forwards pending the release of Blazor client side?
Thank you!
Check the Visual Studio Installer bundled with VS. It should guide you to upgrade to the stable 16.3 release.
If you don’t need the preview anymore, you can remove it with confidence.
Thanks for the feedback. The 16.3 upgrade went smoothly. Do you know which client side Blazor template version I should have (currently there are 2 instances of them, both 010184 with the same description)? Is there a tool to remove old SDKs – command line and apps uninstall don’t work?
My question about the preview was, do I need it for future Blazor releases moving forwards?
Well, actually is kinda confusing. Client-side Blazor is still in preview and it has been released a separated template.
Honestly, that’s the question only Dan Roth knows about 😀
Just found out 010184 is February’s preview 2 SDK. Tried the same in preview 16.4 with the same problem. VS 16.3 shows no Blazor template version at all. Both show 2 instances of Blazor WebAssembly templates – this is driving me nuts!
UPDATE
If it helps anyone, assuming the correct Blazor WebAssembly template is now installed (now reporting CLI v3.0.100 with no mention of preview9.19465.2), I was getting old and multiple versions. So, I removed all the old SDKs I could via Setting, Apps, Uninstall – then manually deleted a load of SDK preview folders under C:\Prgram Files\dotnet. Previews 2, 7 and 8 seemed to block the install of preview 9 and to cause the issue reported.
If I have the correct template, then would suggest PMC and the template dialogue report the preview number as before. If I don’t have the correct template still then bubble!
Finally is there a way I can definitely see that I have indeed the correct version?
Authentication support for Web APIs and single-page apps integrated with IdentityServer
Hi Dan;
Is this support only for the two templates (Angular and React) that is provided or will this work with any JS client like Vue?
The Docs solely focus on React and Angular.
Thanks!
..Ben
Yes, the authentication support should work with Vue as well. Let us know how it works for you!
Great stuff. Blazor is AWESOME!!!
IdentityServer – is it the same as the well-known IdentityServer4 library?
Yup!
Awesome work to everyone involved! When does Blazor Server Side going to go GA? I thought it was going to be in the .NET Core 3.0 release?
Blazor Server is part of .NET Core 3.0 and is now supported for production use.
Blazor WebAssembly is still in preview, but we announced at .NET Conf this week that we expect to ship it in May 2020.
Nice! I had read another blog post about all the great .net core 3.0 updates that didn’t mention Blazor at all. That confused me a bit. I’m super excited to play around with Blazor Server, and I can’t wait for client-side!
Anything we need to know about ASP.NET Core Identity 3.0? Any breaking changes?
Will there be NuGet packages for ASP.NET Core 3.0 any time soon?
The NuGet packages for ASP.NET Core 3.0 are published at this point. However, starting with 3.0 many packages that were previously part of ASP.NET Core are now part of the ASP.NET Core Shared Framework. You can read more about which packages fall in this category here: https://docs.microsoft.com/aspnet/core/migration/22-to-30#remove-obsolete-package-references.
Thanks Mr.Roth
Good luck.
With all the focus on making .NET work with Linux and VS Code with Mac, I’m concerned looking at the Blazor and .NET 5 timelines things aren’t moving fast enough for Windows devs (including those of the ASP.NET sort). Can I please ask if there are enough resources being attributed to Blazor?
I hope you didn’t get that jacket and cushion to lie down on because you’re the sole dev! (Joking!)
Thank you.
Hi Rod,
I’m actually a Program Manager, not a dev :). The real engineering work for Blazor is done by the Blazor software engineering team, which is in turn supported by the broader .NET team and our fantastic Blazor community. We share your desire to move Blazor along as quickly as possible, and we are doing everything we can to make that happen. Since we are a cross-platform framework, these efforts should benefit Windows, Mac, and Linux devs equally.
Daniel Roth
Hi Daniel,
Part of my comment is of course in jest, and you should be under no illusion that I much respect your position. However, the other part of my comment perhaps belies a more serious tenet that it is OK for MS to mistakenly assume Windows devs will remain eternally faithful and never abandon the MS ship, and why should they with the best VS tools? Yet MS lost in the mobile space when it should not have done so.
I refer back to a .NET conference Birmingham (UK) November 2000. It was a ‘2 silo’ approach – WinForms and WebForms. Around and beyond the Silverlight debacle, the number of (often pseudo) silos has been increasing: Web; Mobile; Desktop; IoT; MVC, Xamarin, WPF…
To complicate matters further and indeed make things worse for Windows devs, particularly when UI progress has been frustrated on account of mobile hardware, Windows devs have suffered in silence so that MS might embrace devs from other OS backgrounds.
I say to you that finally I am looking at Flutter and Dart and Kotlin because I am tired of waiting and waiting and waiting for MS to wake up and realise that ‘the screen’ – AKA ‘Windows – ‘AKA ‘Surface’ – tied to services, is the way to evolve beyond the mobile bubble. That is why Blazor is so exciting, yet so frustratingly slow to evolve that we will have to wait to November 2020 to truly be able to rely upon. Meanwhile kudos to UNO for their straight forward thinking, even embracing SVG.
I try to remain enthusiastic and patient.
Yours sincerely,
Rod
Dan, that was VERY, VERY nice of Scott Hunter to sayL
“if it wasn’t because of Dan, we wouldn’t have Blazor”.
Although many people were involved, but you fueled the fire to get developers excited to push MSFT to go with Blazor.
So, a TRUE congrats from all of us Dan.
..Ben
Blazor will be a game changer for me when it allows to call some Azure services (SQL server, Azure Storage etc.) from the client directly.
And when it allows to run the Entity Framework on the client.
After that, it can start a new era of serverless applications development.
I am going to be presenting Blazor as a platform for replacing a Silverlight Project. I don’t want to get down the development road and find that there are front-end controls that don’t exist. Is there such a list of such controls that pertains to this current release?
Hi Gerard,
Blazor ships with very few built-in UI components. Instead, Blazor provides the component model and relies on the community and ecosystem to provide component libraries that fill common needs. You can find quality component libraries from popular vendors like Telerik, DevExpress, Syncfusion, and Radzen, as well as a variety of open source component libraries from the community.
Hi Daniel,
what about Authentication support for Web APIs and single-page apps integrated with IdentityServer?
I can’t find any reference to it in the release note.
Could you please detail it a little more?
Thank you,
A.
You can find more details on the new authentication for SPAs here: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-3.0
While upgrading to ASP.NET 3.0 I´ve encountered a problem while migrating the Startup.cs.
Since UseMvc is not available anymore, how do I migrate my use-case scenario?
Code used for ASP.NET 2.2:
app.UseMiddleware(app.ApplicationServices.GetService())
.UseMvc()
UseMvc() is still available in .NET Core 3.0, although we recommend migrating to use Endpont Routing instead: https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#routing-startup-code.
this comment has been deleted.
I’ve only had a very quick play with Blazor, and was particularly interested to see how easy a “standalone” deployment would be; I might not want to pay for IIS or Azure hosting, or there might be no need for it (e.g. a website with no server-side functionality).
I immediately hit an issue whereby my hosting company (and I’m sure most others that offer this kind of basic hosting) don’t permit DLLs to be uploaded to their servers, so the files in the _framework\bin\ folder get deleted as soon as I upload them.
I don’t know if this is even possible, but couldn’t you give these DLLs a different extension (e.g. “dl_”) when publishing the site from Visual Studio, then rename the files during download to the client (browser) device?
Hi Andrew,
Yes, we’ve seen variants of this issue with Blazor WebAssembly apps and we are tracking providing a solution here: https://github.com/aspnet/AspNetCore/issues/5477. Could you please share with us on the GitHub issue which hosting company you hit this issue with so that we can make sure we test and address your scenario?
Done. Thanks for the quick reply.
I tried blazor with simple Timer so it executes every few seconds..
The timer object does kick in, however the UI not updated?
For example,
on the server side, I have count++;
but @count not updated on the UI?
Thanks
You need to call InvokeAsync to dispatch to Blazor’s SynchronizationContext. See https://docs.microsoft.com/aspnet/core/blazor/components#invoke-component-methods-externally-to-update-state.
Where can we find more information about “Generate strongly typed client code for Web APIs with OpenAPI documents”? Is this similar to Refit or is there a way to generate client code?
Hi John,
We now have support for doing client code generation for Web APIs with OpenAPI specs using community based code generators like NSwag. See https://docs.microsoft.com/en-us/aspnet/core/web-api/microsoft.dotnet-openapi?view=aspnetcore-3.0 for the command-line experience. There is a UI in VS for generating a client as well: Right click on project > Add > Service reference.