[00:00:06] Hi, everyone. I'm Daniel Roth. I'm the [00:00:07] principal product manager for ASP.NET [00:00:09] Core and Blazer on the .NET team. And in [00:00:12] this session, we're going to explore [00:00:13] modern web development with ASP.NET Core [00:00:16] and Blazer in .NET 11. [00:00:19] Now, choosing a web platform, that's [00:00:21] that's a long-term investment. You need [00:00:23] a platform that you can trust. You need [00:00:25] a platform that you can trust to perform [00:00:27] at scale, uh trust to protect from [00:00:29] evolving threats, and trust to help you [00:00:31] deliver as demands increase. In .NET 11, [00:00:35] ASP.NET Core and Blazer help you build [00:00:37] faster apps, uh strengthen your [00:00:39] protections, and make your teams more [00:00:42] productive. [00:00:43] So, let's start with performance. [00:00:46] .NET powers services across Microsoft [00:00:49] from Copilot and Teams to Bing, Azure, [00:00:52] and Xbox. It's a platform that we depend [00:00:54] on ourselves. The performance work that [00:00:57] we do across the runtime and the web [00:00:59] stack is driven by real Microsoft [00:01:01] workloads operating at hyperscale. [00:01:04] Uh these are real production workloads, [00:01:06] not just framework benchmarks. They [00:01:07] handle billions of requests and millions [00:01:10] of users for business-critical scenarios [00:01:12] every day. [00:01:13] For example, uh .NET powers the [00:01:16] personalized content feeds uh across [00:01:18] MSN, Edge, and Windows. These feeds have [00:01:21] served tens of billions of monthly page [00:01:24] views, and they keep benefiting from the [00:01:27] .NET investment. After upgrading from [00:01:29] .NET 8 to .NET 10, uh this team reported [00:01:32] 29% lower P95 uh GC pauses, 11% lower [00:01:36] async plugin latency, and 20% shorter [00:01:40] thread pool queues. So, you don't need [00:01:43] Microsoft's traffic volume to benefit [00:01:44] from that investment. Your application [00:01:46] can benefit from the same runtime [00:01:48] improvements and optimizations. [00:01:52] Now, in .NET 11, we've improved [00:01:53] performance across the web stack uh that [00:01:56] includes more efficient runtime [00:01:58] execution with JIT optimizations reduced [00:02:00] allocation pressure, faster data [00:02:02] processing for JSON and strings and [00:02:04] regular expressions and also for HTTP [00:02:06] handling, and lower overhead for [00:02:09] observability. [00:02:10] For Blazor, that means smaller [00:02:13] WebAssembly downloads, caching for [00:02:16] static server-side rendering, and the [00:02:18] ability also, [00:02:19] excuse me, to pause idle server circuits [00:02:21] to free up those server resources. Many [00:02:24] of these improvements come simply by [00:02:26] upgrading. [00:02:28] Let's make that really concrete with one [00:02:30] improvement in Kestrel, our lightweight [00:02:32] and fast [00:02:34] web server for ASP.NET Core. In .NET 11, [00:02:37] we reduced the overhead of rejecting bad [00:02:40] requests, leaving more capacity [00:02:42] hopefully for the good ones. Previously, [00:02:44] Kestrel threw and propagated exceptions [00:02:46] for malformed HTTP requests and then [00:02:48] went through its normal response setup [00:02:50] to reject them. Now in .NET 11, the [00:02:53] parser returns an error result and [00:02:55] Kestrel can write the response from [00:02:57] pre-allocated fragments. You get the [00:02:59] same HTTP behavior and diagnostics, but [00:03:02] with less work. [00:03:04] In our single-core benchmark, that [00:03:05] improved bad request throughput by [00:03:07] roughly 30%, which is then cycles that [00:03:09] are free for your normal website [00:03:11] traffic. [00:03:14] Okay, so that's performance. Let's next [00:03:16] let's take a look at how the platform [00:03:17] helps protect your apps and users. Now [00:03:20] security isn't something that we finish [00:03:22] in one release. Browsers, they evolve, [00:03:25] authentication patterns change, and [00:03:27] attackers look for new ways in. [00:03:29] We keep improving the infrastructure [00:03:31] that your applications rely on so that [00:03:33] your teams can build on existing [00:03:35] protections rather than having to [00:03:37] implement everything yourselves. [00:03:39] In .NET 11, that includes automatic [00:03:42] cross-site request forgery protection or [00:03:44] CSRF protection, more consistent [00:03:46] authorization metadata handling, [00:03:49] and authentication refresh support for [00:03:51] long-lived connections. [00:03:53] We've also strengthened transport and [00:03:55] request handling and improved Blazor's [00:03:57] compatibility with restrictive content [00:03:59] security policies. [00:04:01] Now your application still needs sound [00:04:03] security design and configuration, but [00:04:05] with .NET 11 you're building on a secure [00:04:08] foundation. [00:04:10] Now sometimes stronger protections mean [00:04:12] more work, you know, adding crypto and [00:04:14] those types of things, but sometimes you [00:04:16] get lucky and it actually means less [00:04:18] work. Automatic cross-site request [00:04:20] forgery or CSRF protection is a great [00:04:22] example. So CSRF protection ensures that [00:04:25] requests come from your app, not another [00:04:28] site that's just misusing an already [00:04:30] signed in browser. [00:04:32] For modern browsers, .NET 11 uses the [00:04:34] browser fetch metadata headers to [00:04:36] automatically detect and block forged [00:04:39] requests. The protection is enabled by [00:04:41] default, so there's no need to generate [00:04:43] or check anti-forgery tokens. Skipping [00:04:45] that token work is also a great [00:04:47] performance win. In our benchmarking [00:04:50] Sorry, in our benchmarking [00:04:53] let's see, with the new header-based [00:04:54] approach handles about four times as [00:04:55] many requests per second [00:04:57] with about 65% less allocation per [00:05:00] request compared with the anti-forgery [00:05:02] token-based validation. So that's less [00:05:04] plumbing, less overhead, and protection [00:05:07] built into the platform. So let me show [00:05:09] you it in action. [00:05:12] So here I have a This is a like a [00:05:14] customer service website where our [00:05:16] customer service rep is trying to help a [00:05:18] user return their docking station, so we [00:05:20] can select whether or not it's they're [00:05:21] going to get a refund or replacement and [00:05:23] select a replacement item. That looks [00:05:26] good. All right, and then here the rep [00:05:28] needs to confirm the plan the resolution [00:05:32] for this return. Now we don't want [00:05:34] someone on to to be able to build a [00:05:36] different website that can forge [00:05:38] requests to our app to confirm [00:05:41] returns like this. So for example, if [00:05:43] someone stands up another website like [00:05:45] this one Now this is this is also on [00:05:47] localhost, but it's it's actually on a [00:05:48] different port, so a different origin. [00:05:50] We don't want them to be able to send [00:05:51] requests to our website to forge a [00:05:54] return. Now if we try to do this, we [00:05:56] won't be able to because ASP.NET Core [00:05:58] will automatically protect us against [00:06:00] cross-site [00:06:02] forged requests. So if I go ahead and [00:06:03] send this request, you see that it does [00:06:05] fail. We get a 400 bad request. And the [00:06:07] reason why is if we look down here and [00:06:09] what the the headers are being sent on [00:06:11] that request, we can see that the [00:06:12] browser is really helping us out and [00:06:14] sending this lovely uh fetch site header [00:06:16] to tell us, hey, this request came from [00:06:18] the same site. Like it was on localhost [00:06:20] like our our main app is on running on [00:06:22] my machine, but it was on a different [00:06:23] port. It's not the same origin. So [00:06:26] ASP.NET Core automatically will see [00:06:27] that, shut down the request, and protect [00:06:29] your application. Now if we do the same [00:06:31] uh form submission but actually from the [00:06:34] application, let's bring up the browser [00:06:35] dev tools again so we can see that that [00:06:37] that actually works. And if we look at [00:06:39] the fetch metadata header headers on [00:06:41] this request that the browser is sending [00:06:43] for us, we can see, yes, okay, this was [00:06:45] same origin. ASP.NET Core sees that, [00:06:47] automatically lets it through. So we [00:06:49] don't have to set up any anti-forgery [00:06:51] tokens in this app. Like the thing [00:06:52] that's, you know, cool about this demo [00:06:53] is that there is what's not in the code. [00:06:55] Like if I search for anti-forgery in the [00:06:58] the program CS file for my application, [00:07:00] it's just not there. So we don't have to [00:07:02] set up tokens and validate them. So less [00:07:04] work, but still secure. So that's the [00:07:06] new CSRF protection uh uh automatic CSRF [00:07:09] protection that's available with with [00:07:11] .NET 11. [00:07:17] Cool. Okay. [00:07:19] What else? Oh, this is the demo. So we [00:07:21] also improved how authentication is [00:07:23] handled for long-lived connections. Uh [00:07:25] SignalR connections can outlive their [00:07:27] credentials. Uh that can mean continuing [00:07:29] with, you know, outdated authentication [00:07:31] state. Uh in .NET 11 uh SignalR can now [00:07:35] re-authenticate an existing connection [00:07:37] uh with fresh credentials without having [00:07:39] to reconnect. Uh your application [00:07:41] obtains those credentials and then [00:07:42] SignalR uses them to update the [00:07:44] connection's uh principle. [00:07:46] Uh in Blazor Server, we use that same [00:07:48] machinery from SignalR to keep [00:07:50] authentication state current uh while [00:07:52] preserving uh the users work. [00:07:55] Now the way this works is on your [00:07:56] SignalR hub, when you're using SignalR [00:07:58] directly, you enable authentication [00:07:59] refresh on the SignalR [00:08:01] SignalR hub options. Uh if you set the [00:08:04] close on authentication expiration [00:08:06] option, that will also um close [00:08:09] um close the connection if the uh uh the [00:08:11] authentication token refresh fails. [00:08:14] Uh on the JavaScript side, like on the [00:08:15] client side, you can opt in to automatic [00:08:17] refresh by calling with authentication [00:08:19] refresh. Uh I believe the .NET SignalR [00:08:21] client uh will do that automatically. [00:08:23] And then in Blazor Server, we already [00:08:25] set this up for you uh so that you get [00:08:27] uh uh token refresh on your on the on [00:08:29] the the the component hub and from the [00:08:31] the client. [00:08:32] Let me show you that in action. [00:08:36] Okay, back to our app. [00:08:38] Oh, we can close the browser dev tools. [00:08:40] All right, so let's um let's look at [00:08:42] another uh return request. All right, so [00:08:45] this one. And okay, you can see here [00:08:47] that um uh you we have the option to do [00:08:50] either a refund or a replacement. Um and [00:08:52] you can see up above that this [00:08:54] particular support engineer uh support [00:08:57] rep is allowed to issue refunds, um [00:09:00] which is great. Now uh let's imagine [00:09:02] though that however that maybe they're [00:09:03] being a little too um too generous with [00:09:05] with with issuing refunds and someone [00:09:07] notices and they decide to revoke their [00:09:09] permission uh for issuing refunds. So [00:09:11] I'm going to have this little portal, [00:09:13] admin portal here where I'm going to [00:09:14] remove the refund approval for this [00:09:16] particular user. So they should no [00:09:17] longer be able to do that. Now watch up [00:09:18] here in the corner. The refund [00:09:20] approval's still currently allowed, but [00:09:22] we should see that refresh. And there it [00:09:24] goes. You see that? So now refund [00:09:26] approval was removed. So if I scroll [00:09:28] down, you can see that I'm no longer [00:09:29] able to issue a refund, but I didn't [00:09:31] like lose my connection in order to [00:09:33] establish that new authentication state. [00:09:34] Like all the data from the replacement [00:09:36] stuff that I had typed in earlier, it's [00:09:38] still still there. Um none of that got [00:09:40] got lost. We were able to refresh the [00:09:42] authentication state on the same [00:09:45] connection. And to prove that this is [00:09:46] really working with authentication [00:09:47] state, that it's not like, you know, [00:09:49] using some other UI trickery, if we go [00:09:51] look at the Razor code for that [00:09:53] resolution editor, you can see up above [00:09:55] that that um that badge [00:09:58] is being set up with this authorization [00:09:59] view based off of this particular [00:10:01] policy. Uh down below, if we look at how [00:10:03] things get saved, where is that? Save [00:10:06] async, I think in here. You can see that [00:10:07] we 're doing, you know, a proper [00:10:08] authorization check um before allowing [00:10:11] someone to, you know, submit uh uh a [00:10:14] refund request. So, this is actually [00:10:15] using the user's authentication state. [00:10:18] And then if we go back, we should be [00:10:20] able to, you know, restore their uh [00:10:21] approval and that should flip back to [00:10:23] green, and it does. Now, this is um uh [00:10:26] uh basically like refreshing at a [00:10:27] regular interval. Like whenever the [00:10:28] authentication token is about to expire, [00:10:30] a refresh will occur. So, it's not like [00:10:32] event-based. It's not happening in in [00:10:34] like real time. In the case of this [00:10:36] demo, I shortened the the refresh time [00:10:38] so that it's easier to see. Normally, [00:10:39] this would be a little longer as your [00:10:41] depending on the length of the the the [00:10:43] expiration time for your authentication [00:10:45] tokens. [00:10:46] All right. [00:10:47] Cool. So, that's the new [00:10:50] authentication refresh support in [00:10:54] SignalR which Blazor then builds on top [00:10:56] of [00:10:57] All right. That's security. Now, let's [00:10:58] talk lastly about productivity. Now, [00:11:01] trust in a platform also means knowing [00:11:03] that your team can build and maintain [00:11:05] applications effectively. [00:11:07] ASP.NET Core helps your team build APIs [00:11:10] and web UI using shared C# skills, [00:11:13] libraries, and tooling. Razor tooling, [00:11:16] hot reload, and AI assistants uh helps [00:11:18] you iterate faster using your favorite [00:11:21] coding tools. [00:11:22] Now, we uh what can that mean for like a [00:11:24] small development team? Uh Toscano [00:11:26] Digital uh provides a great example. Uh [00:11:29] Toscano's uh small team of five [00:11:30] developers, they built a public real [00:11:32] estate portal serving about 5 million [00:11:34] sessions and 11 million page views [00:11:36] annually annually. And this was [00:11:37] alongside their already implemented [00:11:39] internal Blazor-based CRM uh system. [00:11:43] Uh their requirements included a search [00:11:44] discoverability, uh mobile performance, [00:11:48] excuse [clears throat] me, and rich [00:11:49] interactivity. Uh they combined uh .NET [00:11:52] and Blazor rendering strategies to meet [00:11:54] those needs. They were they were able to [00:11:56] be more productive by leveraging C# full [00:11:58] stack uh and also uh the many built-in [00:12:00] features in the the .NET platform. [00:12:04] Now, it can also help to be able to uh [00:12:07] build on a great ecosystem. I want to [00:12:09] give a huge thank you to uh Infrastructs [00:12:12] and Syncfusion. Uh they're not just [00:12:14] building on Blazor and providing really [00:12:16] great Blazor component libraries. Uh [00:12:18] they're also helping to build Blazor. Uh [00:12:21] both Infragistics and Syncfusion have [00:12:22] made a very generous contribution to the [00:12:25] .NET open source ecosystem, providing uh [00:12:27] uh a uh selection of their Blazor [00:12:29] components in a free and open source [00:12:31] manner. Uh Infragistics has made more [00:12:34] than 50 Ignite UI for Blazor components [00:12:36] available for free and open source, [00:12:38] including grid light, inputs, [00:12:40] navigation, layouts, and more. [00:12:42] Syncfusion has released the free and [00:12:44] open source Syncfusion toolkit for [00:12:46] Blazor with charts, inputs, calendars, [00:12:48] and dialogues. Uh both libraries are MIT [00:12:51] licensed uh including for commercial [00:12:53] use. Uh these are separate open source [00:12:55] offerings from their normal commercial [00:12:57] uh component suites. Now their engineers [00:13:00] are also investing directly in the [00:13:03] platform. Uh Infragistics contributed [00:13:05] new Blazor analyzers in .NET 11 that [00:13:07] catch common coding mistakes. Syncfusion [00:13:10] contributed framework and scaffolding [00:13:11] fixes, clear diagnostics, and [00:13:13] substantial testing uh for new Blazor [00:13:15] features. Uh those framework [00:13:17] contributions benefit every Blazor [00:13:19] developer uh whichever components they [00:13:21] use and we're excited to keep working [00:13:23] with uh with our great partners. [00:13:29] Okay, so let's take a look at some of [00:13:30] the productivity improvements that are [00:13:32] actually in .NET 11 uh starting with the [00:13:34] new C# union support uh [00:13:37] and API contracts. So ASP.NET Core in [00:13:40] .NET 11 supports C# unions for both APIs [00:13:43] and web UI development. Uh for APIs, [00:13:45] System.Text.Json handles the [00:13:47] serialization and ASP.NET Core uh [00:13:50] handles generating OpenAPI 3.2 schemas [00:13:53] that describe the union's possible [00:13:55] cases. You can also use C# unions in [00:13:57] your Razor views and in your Blazor [00:13:59] components. So here we have an example [00:14:01] of an API that you can see that it's [00:14:03] either returns either a refund or a [00:14:06] replacement. System.Text.Json correctly [00:14:08] serializes the active case and the [00:14:10] generated OpenAPI schema uh [00:14:13] describes both possibilities and I'll [00:14:14] show you that real real quick. [00:14:18] Uh let's go back to [00:14:21] code. [00:14:22] So you remember that in the in the app [00:14:24] actually we'll show the app in the app [00:14:25] real quick. So in the app you saw we had [00:14:26] the choice of either picking a refund or [00:14:28] a replacement. And these have different [00:14:30] properties um you know the different [00:14:32] models. Uh how can we actually model [00:14:34] this in our app? So let's see you know [00:14:36] how we do it in the code. So for [00:14:38] representing a return resolution we can [00:14:41] use a C sharp union. So here's our C [00:14:43] sharp union and it can be either a [00:14:45] refund or a replacement. And you can see [00:14:47] that it's set up to be serializable with [00:14:49] a system text JSON and deserializable. [00:14:52] And then we can use this in some in [00:14:53] minimal APIs. Like up above here you can [00:14:55] see I've got a couple of APIs that are [00:14:57] returning that resolution union type. Uh [00:15:00] the top one's returning a refund and the [00:15:01] bottom one's returning a replacement. We [00:15:03] can try that out by sending some [00:15:04] requests from our .http file. So here's [00:15:07] the response from the refund endpoint. [00:15:08] You can see it's nicely formatted JSON [00:15:10] payload representing the refund. Uh but [00:15:12] if we ask instead for a replacement we [00:15:14] instead get the replacement structure. [00:15:16] So system text JSON will correctly [00:15:18] serialize the active case. There's no [00:15:20] need for any like wrappers or type [00:15:22] discriminators in order to to make that [00:15:24] happen. In the open API representation [00:15:26] for that API um here's the open API spec [00:15:30] that gets generated. You know first we [00:15:31] got to point out that we we support open [00:15:33] API 3.2 now with all of its great new [00:15:35] features, latest version of the spec. [00:15:37] And then if we scroll down here let me [00:15:39] see if I can find the resolution schema [00:15:40] again. There it is. You can see that [00:15:42] we're correctly generating the this [00:15:43] could be any of a refund or a [00:15:47] replacement. So our API description is [00:15:49] nice and clear about [00:15:51] what the API can return. Um in your UI [00:15:54] coding you can of course use the same [00:15:56] union type. Like here we have a switch [00:15:57] statement where we're switching over the [00:16:00] the resolution values, whether it's a [00:16:01] refund or a replacement, and then just [00:16:03] rendering the corresponding UI content. [00:16:05] So that works too. [00:16:11] Cool. Now business rules often need to [00:16:15] be asynchronous. Like maybe you need to [00:16:16] go check some data in a database or call [00:16:18] some some API to get some some [00:16:20] information. In .NET 11, data [00:16:23] annotations now includes new async [00:16:25] validation APIs. There's the new async [00:16:28] validation attribute which supports [00:16:30] creating custom [00:16:31] reusable rules. And then there's also [00:16:33] the new I async validatable object [00:16:35] interface that supports object level [00:16:37] checks including rules that involve [00:16:39] several fields. Minimal APIs in Blazer [00:16:41] support both and we can see that in [00:16:43] action in our application. So let's [00:16:46] let's do like an inventory check in our [00:16:48] app. Let's do a quick demo of that. [00:16:51] So back in our app. So if we ask to do [00:16:54] if the if the service rep decides to do [00:16:55] a replacement, you can see they have to [00:16:56] pick a replacement model. If I pick this [00:16:59] top one, let's see if I can catch it [00:17:00] real quick right there. Okay. You can [00:17:02] see that the UI is automatically doing [00:17:04] an inventory check and this is an async [00:17:06] validation check to check the the the [00:17:08] inventory. We get a nice little spinner [00:17:09] to let the user know that something's [00:17:11] going on. Unfortunately that one's not [00:17:13] available. If we pick the other one, we [00:17:14] can see the same async validation check [00:17:16] occurs and that one's good to go. How do [00:17:18] we model that in our code? If we go back [00:17:20] to the code, we can see here's the [00:17:21] replacement request model type. You can [00:17:24] see it's using normal data annotation [00:17:26] attributes for its validation rules. We [00:17:28] have one custom one which is this in [00:17:30] stock attribute and we can see below how [00:17:32] that's implemented. In stock attribute [00:17:34] is a async validation attribute, the new [00:17:36] the new type in .NET 11 which allows us [00:17:39] to implement our async validation logic. [00:17:41] When you're using this in Blazer, you [00:17:42] don't really have to do anything. Like [00:17:43] you can just implement your forms as [00:17:45] normal. [00:17:46] Like here's that form that we were just [00:17:47] messing around with. It's just an edit [00:17:48] form. It's using the normal data [00:17:50] annotations validator, but we get some [00:17:52] APIs to help us out with [00:17:54] the generating a good end user [00:17:55] experience. Like we can detect if [00:17:57] validation is currently pending so we [00:17:59] can show that little spinner to the user [00:18:01] to let them know that the validation [00:18:03] logic is still running. [00:18:05] You can of course do this same async [00:18:08] validation in your minimal APIs. We can [00:18:09] take this same replacement request type [00:18:12] and put it in a minimal API which we've [00:18:14] got here. So there's the same type. If [00:18:16] we send a request to that that [00:18:19] replacements validate an endpoint. Let's [00:18:22] do one first that asks to replace using [00:18:24] a model that's not available. You can [00:18:26] see that the same async validation check [00:18:27] runs there too. If we send a request for [00:18:30] one that is available in inventory, we [00:18:32] get a 200 okay. Okay, so async [00:18:34] validation and it works with both Blazer [00:18:36] and minimal APIs. [00:18:41] All right. [00:18:42] Now Blazer helps you display large lists [00:18:44] of data with the built-in virtualized [00:18:47] component. We've had that for a while. [00:18:49] It renders just the items in and around [00:18:52] the visible area and updates them as you [00:18:54] scroll. So you don't have to like render [00:18:55] everything in the list all all at once [00:18:58] up front. Now in .NET 11 virtualized now [00:19:00] handles variable height items, so rows [00:19:02] can grow with their content and anchor [00:19:05] modes now allow you to control how the [00:19:06] scroll position works. Like if you want [00:19:08] to pin the scroll position to the bottom [00:19:10] as items get get added or removed. We've [00:19:12] also improved the scroll position [00:19:14] stability as items get added to the [00:19:16] list. Let me show you that real quick. [00:19:21] Right back over in the app. [00:19:23] So here we have this service queue page [00:19:25] which has a long showing all the the [00:19:27] service [00:19:29] items that are in the queue and you can [00:19:30] see there's a lot of them. There's like [00:19:31] 10,000 that we're actually rendering [00:19:32] here. [00:19:33] But it still scrolls nicely. That's [00:19:34] because this list is fully virtualized. [00:19:36] And things that are new here is we can [00:19:38] actually like expand these items so that [00:19:39] they have different heights and that [00:19:41] works perfectly fine. We can also jump [00:19:44] to a particular item in the virtualized [00:19:45] list. Like here we just jump to the [00:19:47] 5,000th item. We can jump to the start. [00:19:49] We can jump to the end. When we're at [00:19:51] the end, we can also choose I've got a [00:19:53] little picker here where we can change [00:19:55] the behavior. Let's say we want the the [00:19:57] virtualized list to stay pinned to the [00:19:59] end when the user is at the bottom when [00:20:01] items get added. So I'm I'm at the [00:20:02] bottom. I'm pinning it. I'm anchoring to [00:20:04] the end of the queue. If I add some [00:20:06] items to the list, you can see that the [00:20:07] scroll position follows along with the [00:20:09] items that get get added. Whereas if I'm [00:20:11] like kind of in the middle of the list, [00:20:12] you know, reading something and [00:20:13] something gets added, the scroll [00:20:15] position stays stable. It doesn't It [00:20:16] doesn't jump around anymore. The anchor [00:20:18] mode only follows along when you're at [00:20:20] the either the bottom or you could also [00:20:22] pin to the to the top of the list, or [00:20:24] pin to both, or neither. You have that [00:20:26] choice. To see what that looks like in [00:20:28] code, [00:20:29] here's the service queue Razor code. [00:20:32] There's our virtualized component. And [00:20:34] if we scroll over to the side, we can [00:20:35] see this is how you specify what anchor [00:20:37] mode that you want to use, and we're [00:20:38] just binding to the the various values [00:20:40] in that drop-down list. We can also grab [00:20:43] the the virtualized component instance, [00:20:45] which I'm capturing in this virtualizer [00:20:47] item. And then let's jump down below to [00:20:50] see where we're using that. Here you can [00:20:51] see we're taking that virtualizer and [00:20:53] calling the new scroll to item async API [00:20:55] so that we can hop around to anywhere in [00:20:57] the list that that we want to. So that's [00:20:59] the new virtualize [00:21:00] improvements in .NET 11. [00:21:05] Oh my god, so much stuff. [00:21:07] All right, some tooling stuff. So let's [00:21:09] take a look at the tools that your team [00:21:10] uses every day. [00:21:12] Razor [00:21:13] keeps you in the flow while building [00:21:14] great web UI. Razor tooling in Visual [00:21:17] Studio and VS Code offers richer code [00:21:20] actions, refactoring support across C# [00:21:23] and Razor now, and faster hot reload. [00:21:26] You can also now apply C# formatting [00:21:28] preferences through editor config in [00:21:30] your Razor files, which is awesome. You [00:21:32] can sort and remove your using [00:21:35] directives. And we've also introduced a [00:21:36] new tight compact syntax in Razor for [00:21:40] specifying your web asset paths using [00:21:42] tilde slash instead of having to use the [00:21:44] old at assets [00:21:45] syntax. [00:21:46] And I don't know, do we have time for [00:21:48] these? Let's see if I can show you just [00:21:49] like one or two real quick. [00:21:50] Also Emmet support. So let me let me [00:21:52] show you this. Like if in in Visual [00:21:53] Studio now, like you can use the like [00:21:55] really nice compact Emmet syntax if [00:21:58] you're familiar with that from like [00:21:59] doing it in Visual Studio Code. Like [00:22:00] let's say I want an unordered list and I [00:22:02] want a bunch of list items in them and I [00:22:03] want three of them, and I just hit tab [00:22:06] on that, and that's short Emmet syntax [00:22:09] is what that's called. Visual Studio now [00:22:10] supports that in your Razor files, so [00:22:12] you can just type that and you can get [00:22:13] this. So that's pretty cool. Other [00:22:15] things, [00:22:16] we can now remove and sort our using [00:22:18] statements in the Razor file. So let's [00:22:20] do remove and sort, and you can see that [00:22:21] unused using statement just just [00:22:23] disappeared. [00:22:24] And then oh, editor config, like let's [00:22:26] see Let's say all my C sharp code like I [00:22:28] really want don't like having the the [00:22:31] the curly braces on the the same column. [00:22:33] We can go into our editor config and I [00:22:34] don't know why you would want to do [00:22:35] this, but some people I guess love this [00:22:36] format. I'm not a big fan, but I know [00:22:38] other people like it. We can change that [00:22:40] to none and if we reformat the document [00:22:44] Uh mis mistyped that. Let me try D There [00:22:46] we go. Okay. So now all of our C sharp [00:22:48] statements are have the tilde the the [00:22:50] curly braces on the side. [00:22:52] [clears throat] [00:22:53] Oh Oh shoot. Uh sorry. [00:22:56] [laughter] [00:22:57] Then guys guess they couldn't see that [00:22:58] demo. Let me go back. So [00:23:00] well [00:23:02] [laughter] [00:23:02] Here's Emmet. So Emmet you can type [00:23:04] Emmet statements in there. Hit just hit [00:23:05] tab. Let me Let me do actually type [00:23:07] valid Emmet. There we go. So there's all [00:23:09] your your list items. Uh you can uh also [00:23:13] remove and sort your using statements. [00:23:15] So let me undo this change. Let see if I [00:23:17] can Yeah just undo that one line. Yes. [00:23:20] Okay. Great. [00:23:22] So up above you can see this using [00:23:23] statement's not being used. It's kind of [00:23:24] grayed out. Remove and sort will remove [00:23:25] it. And then editor config that all [00:23:27] works now. Like right now I guess I 'm [00:23:29] using the less desirable curly brace [00:23:32] syntax where it's on the same line as [00:23:33] the uh directives. If I go ahead into my [00:23:35] editor config and switch this to all, [00:23:38] save that and then reformat this [00:23:39] document, we should be able to see that [00:23:41] the curly braces now line up. Sorry [00:23:43] about the little little demo demo snafu [00:23:45] there. Okay. So bunch of great new Razor [00:23:47] features, Razor tooling features. [00:23:51] Uh some other tooling features that are [00:23:52] worth calling out. We have added support [00:23:54] for configuring uh Entra ID based [00:23:56] authentication uh in your Blazer web [00:23:58] apps uh both from the command line using [00:24:00] the .NET scaffold tool or from Visual [00:24:02] Studio using add scaffolded item. [00:24:04] Uh we've also been working closely with [00:24:06] our friends on the GitHub Copilot team [00:24:07] to improve .NET and C sharp development [00:24:09] experience. Uh the way we do this is [00:24:11] through all the various uh plugins, the [00:24:13] AI plugins that we provide on the .NET [00:24:15] Skills GitHub repo. The ASP.NET Core and [00:24:18] Blazer plugins provide specialized [00:24:20] skills for APIs, for components, forms, [00:24:22] authentication, and a whole lot more. [00:24:24] And then there's the Core .NET plugin [00:24:26] that adds general .NET skills, C sharp [00:24:28] language intelligence, uh [00:24:30] a language intelligence for Razor. [00:24:33] Uh we back these skills also with a [00:24:34] whole bunch of evaluation tests which we [00:24:36] keep running and evaluating as new [00:24:37] models come online. To get started, just [00:24:40] go to the repo at [00:24:41] github.com/dotnet/skills. [00:24:45] Now you can further elevate your web [00:24:47] development experience with Aspire. [00:24:49] Aspire helps your team connect, run, and [00:24:52] debug your whole application locally, [00:24:54] and you can now do that with Blazor [00:24:56] WebAssembly apps. So you can debug the [00:24:58] browser client to the back end together [00:25:00] with configuration, service discovery, [00:25:02] and telemetry integrated into the [00:25:04] experience. We've added a new Blazer [00:25:07] gateway component that provides a [00:25:09] consistent host for your Blazor [00:25:10] WebAssembly apps during development and [00:25:12] also in production that also facilitates [00:25:14] a lot of the Aspire integration. And [00:25:16] when running in the browser with Blazor [00:25:18] WebAssembly, we now support running your [00:25:20] .NET code on a background web worker so [00:25:22] you can move compute intensive code off [00:25:24] of the UI thread onto a background [00:25:26] worker so you can keep the UI running [00:25:28] while you're doing that CPU intensive [00:25:30] stuff. [00:25:31] All right, let me see if I can get to [00:25:32] squeeze this one last demo in really [00:25:34] quick. So this is a a different [00:25:36] application. This is a [00:25:38] a like [00:25:40] device support website and you can see [00:25:42] that I've got this all wired up here to [00:25:44] work with Aspire. Now there's a bunch of [00:25:46] things going on here, but this is the [00:25:47] actual Blazor WebAssembly app, this [00:25:48] client project. And then we have a back [00:25:50] end API. [00:25:51] And then we have the normal Aspire [00:25:53] stuff, like there's our Aspire app host [00:25:54] and the the the service defaults. And [00:25:56] then we have some things that are new. [00:25:57] We have this client defaults project. [00:26:00] That's what sets up all the Aspire [00:26:02] goodies in our Blazor WebAssembly app on [00:26:04] the client. And then we have this worker [00:26:06] project which enables us to run some [00:26:08] .NET code on a background web worker if [00:26:10] we don't want to run it on the the the [00:26:12] UI thread. We have project templates for [00:26:13] both this worker [00:26:15] project and the the client client [00:26:16] defaults that you can just use. Okay, so [00:26:18] what does this enable when you run the [00:26:19] application? [00:26:21] Let me show you the app real quick. So [00:26:24] here we see the app running in Aspire. [00:26:25] You can see everything is showing up [00:26:26] nicely in the dashboard. Like there's [00:26:28] our Blazor WebAssembly app and it's [00:26:30] running hosted on the uh the new gateway [00:26:32] component that we've added. Um the API [00:26:35] is is this diagnostics API. That's the [00:26:37] the back-end API for the application. We [00:26:39] go to the app and let's uh try this out. [00:26:41] So what what this is is like you have [00:26:43] someone who has a docking station and [00:26:44] it's like not working and they can [00:26:46] upload like a diagnostics file to like [00:26:49] help troubleshoot. So let's go ahead and [00:26:50] upload this set of diagnostics that they [00:26:52] collect collected from their device. Um [00:26:54] good. Okay, that's set up. Now we can [00:26:57] use the website to analyze the data in [00:26:59] that diagnostic bundle. If we do that by [00:27:01] default on the UI thread, let's this [00:27:03] will take some CPU load. You can see [00:27:04] that a lot of the UI gestures now I [00:27:06] can't click on anything. I mean it [00:27:07] worked, but like the UI whole uh froze. [00:27:10] If I instead move that work onto a web [00:27:12] worker, which is now supported in .NET [00:27:14] 11, you can see that all the UI stuff [00:27:16] stays responsive and I'm still able to [00:27:18] to render the the do the analysis and [00:27:20] render the content. By the way, I'm [00:27:22] using all those new Blazer oh free and [00:27:24] open source Blazer components from [00:27:25] Infragistics and Syncfusion here. Like [00:27:27] this is the uh the grid light component [00:27:29] in Ignite UI. This is a drop down from [00:27:31] Ignite UI and down here at the bottom [00:27:33] this chart is coming from the Syncfusion [00:27:35] toolkit for Blazer. So that's really [00:27:36] cool. Uh lastly, you can also debug now [00:27:39] your Blazer web assembly apps. You can [00:27:40] see over here in the corner that there [00:27:41] is a debug in browser button that now [00:27:43] shows up. So we can click on that [00:27:46] and what that's going to do is that's [00:27:47] going to launch a browser that's all set [00:27:48] up for doing debugging uh so that I can [00:27:50] hit my break points when I'm trying to [00:27:52] develop my Blazer web assembly app. [00:27:54] All right. [00:27:55] And I think we'll just like trust me on [00:27:57] that one because of uh just because of I [00:27:59] know I'm over time. [00:28:01] All right, cool. So that is what I [00:28:04] wanted to show [00:28:05] to to you today. I hope you enjoyed [00:28:07] learning about all of the modern web [00:28:08] development features for ASP.NET Core [00:28:11] and Blazer in .NET 11. Obviously [00:28:13] choosing a web development platform is a [00:28:14] big choice. ASP.NET Core and Blazer in [00:28:17] .NET 11 is built to be a platform that [00:28:19] you can trust. Trust to perform, trust [00:28:21] to protect, and trust to deliver. We've [00:28:23] seen many of these features today, but [00:28:25] of course there were some we weren't [00:28:26] able to get to. So be sure to check out [00:28:28] some of the other sessions at .NET Conf [00:28:30] to learn all about those. And with that, [00:28:32] I encourage you to go and get started [00:28:34] with .NET 11. Download it today from [00:28:36] get.net/ 11 and build your next great [00:28:40] web application. Thanks, folks.