The .NET Stacks #53: 🚀 This issue was compiled ahead of time
Tags: dotnet, csharp, azure
Published: 2021-06-13 16:15:26

---
title: The .NET Stacks #53: 🚀 This issue was compiled ahead of time
published: true
date: 2021-06-13 06:00:00 UTC
tags: dotnet,csharp,azure
canonical_url: https://www.daveabrock.com/2021/06/13/dotnet-stacks-53/
---

![Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3g5mza4h7zlco1td6igz.png)

Happy Monday, all. I wanted to thank everybody for the birthday wishes as the newsletter turned 1 last week. Also, welcome to all the new subscribers!

This week wasn't as crazy as we're recovering from Build, but as always, there's plenty to discuss. Let's get started.

- One big thing: Taking a look at Blazor WebAssembly AOT
- The little things: NuGet improvements in Visual Studio, Tye gets a VS Code extension
- Last week in the .NET world

* * *

## One big thing: Taking a look at Blazor WebAssembly AOT

With Blazor, [you've got two hosting models](https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-models?view=aspnetcore-5.0) to consider, Blazor Server and Blazor WebAssembly.

With Blazor Server, your download size isn't a concern. You can leverage server capabilities with all the .NET-compatible APIs, and you can use thin-clients—you will, however, you need to consider the higher latency and scale if you have a lot of concurrent users. (Unless you have _a lot_ of concurrent connections, it likely won't be an issue.)  With Blazor WebAssembly, you can leverage client capabilities and a fully functioning app once the client downloads it. If you want to embrace Jamstack principles with a SPA calling off to serverless APIs (with attractive options like Azure Static Web Apps), Blazor WebAssembly is a nice option. The download size is larger, and apps do take significantly longer to load, though.

In my experience across the community, I do see many Blazor scenarios geared towards Blazor Server. Many times, folks are also packaging an ASP.NET Core API, and the download size and loading times of WebAssembly might be holding people back. "I want to wait until we get AOT," I've heard a lot of people say.  

Last week, with .NET 6 Preview 4, Blazor ahead-of-time compilation (AOT) [is finally here](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#blazor-webassembly-ahead-of-time-aot-compilation). With AOT, you can compile .NET code directly to WebAssembly to help boost runtime performance. Before AOT, Blazor WebAssembly apps run from a .NET IL interpreter, meaning the .NET WebAssembly code is significantly slower than a normal .NET runtime (like with Blazor Server).

I gave it a go using Steve Sanderson's [Picture Fixer app](https://github.com/SteveSandersonMS/PictureFixer) featured in Build talks and the .NET 6 Preview 4 release announcement. As mentioned in the announcement, you need to do two things:

- Install the Blazor WebAssembly AOT build tools as an optional .NET SDK workload
- Add `<RunAOTCompilation>true</RunAOTCompilation>` to your project file

Then, you'll need to publish your application. On my beefy Dell XPS 15 and its 64 gigs of RAM, it took almost 15 minutes to AOT 15 assemblies and use the [Emscripten toolchain](https://emscripten.org/docs/tools_reference/emcc.html) to do the heavy lifting. The team notes they are working on speeding this up, but it's good to note this wait only occurs during publish time and not local development. With AOT in place, you can see dramatic changes in data-intensive tasks specifically.

As with the decision to go with Blazor Server or Blazor WebAssembly, you need to consider tradeoffs when introducing AOT with your Blazor projects. As AOT-compiled projects are typically double the size, you need to consider the value of trading off load time performance for runtime performance. You can pick and choose when you use AOT, of course, so typical use cases would take a hybrid approach and leveraging AOT specifically for data-intensive tasks.

When Steve Sanderson [talked to us](https://www.daveabrock.com/2021/01/17/dev-discussions-steve-sanderson/) a while back, he said:

> If we can get Blazor WebAssembly to be faster than JS in typical cases (via AoT compilation, which is very achievable) and somehow simultaneously reduce download sizes to the point of irrelevance, then it would be very much in the interests of even strongly JS-centric teams to reconsider and look at all the other benefits of C#/.NET too.

AOT is a big step in that direction. The size of the .NET runtime will never compare to small JS frameworks, but getting close to download size and performance will be a giant step towards providing a modern, fast SWA solution for folks open to the .NET ecosystem.

* * *

## NuGet improvements in Visual Studio, Tye gets a VS Code extension

Last week, Christopher Gill [announced that Visual Studio is introducing NuGet Package Suggestions in Visual Studio 16.10](https://devblogs.microsoft.com/nuget/intellicode-package-suggestions-for-nuget-in-visual-studio/). With IntelliCode Package Suggestions, NuGet uses your project's metadata—like what packages you have installed and your project type—to suggest packages you might need. Package suggestions are shown in the NuGet Package Manager UI before you enter a search query.

As for the fine print, it currently only works on the project level and does not suggest packages outside of _nuget.org._ Also, it won't support deprecated packages or ones that are transitively installed.

* * *

Also from last week, Microsoft [rolled out a Visual Studio Code extension for Tye](https://devblogs.microsoft.com/dotnet/announcing-visual-studio-code-extension-for-tye/). If you aren't familiar Project Tye is an open-source project that [helps developers work with microservices and distributed applications](https://www.daveabrock.com/2020/08/19/microservices-with-tye-1/).

We're seeing a lot of nice updates for Tye, and I wonder when it'll get out of the "it's experimental, things might break" phase. For example, the official repo on GitHub still states: "_Project Tye is an open source experiment at the moment. We are using this time to try radical ideas to improve microservices developer productivity and see what works...For the duration of the experiment, consider every part of the tye experience to be volatile._" It has a lot of nice use cases with Dapr, for example, and I'd love to see when Microsoft is going to put a ring on it.

* * *

## 🌎 Last week in the .NET world

### 🔥 The Top 3

- David Pine [builds a video chat app with ASP.NET Core 5.0, Angular 11, and Twilio Programmable Video](https://www.twilio.com/blog/build-video-chat-app-asp-net-core-angular-11-twilio-programmable-video).
- Christopher Gill [introduces IntelliCode package suggestions for NuGet in Visual Studio](https://devblogs.microsoft.com/nuget/intellicode-package-suggestions-for-nuget-in-visual-studio).
- Mark Downie [interprets async code in CPU traces](https://www.poppastring.com/blog/interpreting-async-code-in-cpu-traces).

### 📢 Announcements

- Jon Galloway [announces Visual Studio 2019 for Mac version 8.10](https://devblogs.microsoft.com/visualstudio/visual-studio-2019-for-mac-version-8-10-is-now-available).
- Pratik Sanglikar [announces the Visual Studio Code extension for Tye](https://devblogs.microsoft.com/dotnet/announcing-visual-studio-code-extension-for-tye).
- Dapr 1.2 [is now available](https://blog.dapr.io/posts/2021/05/27/dapr-v1.2-is-now-available/).
- Josh Love [introduces the Azure Functions extension libraries for the Azure SDK](https://devblogs.microsoft.com/azure-sdk/introducing-the-new-azure-function-extension-libraries-beta/).
- In JetBrains news, Khalid Abuhakmeh [introduces real-time inspections in dotMemory Allocation Analysis](https://blog.jetbrains.com/dotnet/2021/06/01/investigate-memory-issues-with-ease-introducing-real-time-inspections-in-dotmemory-allocation-analysis/), Alexander Kurakin [announces an EAP for Rider 2021.2](https://blog.jetbrains.com/dotnet/2021/05/31/rider-2021-2-eap/) and [ReSharper 2021.2](https://blog.jetbrains.com/dotnet/2021/05/31/resharper-2021-2-eap/), and Cake [for Rider 1.0 is released](https://cakebuild.net/blog/2021/06/cake-rider-1.0.0-released).

### 📅 Community and events

- Aaron Stannard [chimes in on the IdentityServer drama](https://aaronstannard.com/dotnetoss-free-lunch-ends/).
- For community standups: Xamarin [recaps Build 2021](https://www.youtube.com/watch?v=cObI_rRCEcY), and Entity Framework [introduces EF Core compiled models](https://www.youtube.com/watch?v=XdhX3iLXAPk).
- Stack Overflow [was acquired for $1.8 billion](https://techcrunch.com/2021/06/02/stack-overflow-acquired-by-prosus-for-a-reported-1-8-billion/).

### 🌎 Web development

- Hassan Habib [builds contextual experiences with Blazor](https://devblogs.microsoft.com/aspnet/building-contextual-experiences-w-blazor).
- Cody Merritt Anhorn [builds a template using Blazor and Contentful CMS](https://codyanhorn.tech/blog/blazor/contentful/2021/05/29/Blazor-and-Contentful-CMS-Blog-Template.html).
- David Grace [builds a Connect 4 game with Blazor](https://www.roundthecode.com/dotnet/blazor/create-connect-4-blazor-webassembly-in-hour).
- Damien Bowden [verifies vaccination data with ASP.NET Core and Mattr](https://damienbod.com/2021/05/31/verify-vaccination-data-using-zero-knowledge-proofs-with-asp-net-core-and-mattr/).
- Gopi Govindasamy [dynamically renders a component in a Blazor app](https://www.syncfusion.com/blogs/post/how-to-dynamically-render-a-component-in-a-blazor-application.aspx).
- Jon Hilton [walks through choosing a Blazor component library](https://jonhilton.net/choosing-a-blazor-component-library/).
- Marinko Spasojevic [writes about asynchronous programming with async and await in ASP.NET Core](https://code-maze.com/asynchronous-programming-with-async-and-await-in-asp-net-core/).

### 🥅 The .NET platform

- Kristoffer Strube [writes about new LINQ extensions in .NET 6](https://blog.elmah.io/new-linq-extensions-in-net-6-and-benchmarks/).
- Richard Lander [posts a discussion about the .NET type system](https://devblogs.microsoft.com/dotnet/conversation-about-the-net-type-system) and [about .NET interop](https://devblogs.microsoft.com/dotnet/conversation-about-net-interop).
- Andrew Lock [benchmarks various reflection methods for calling a constructor in .NET](https://andrewlock.net/benchmarking-4-reflection-methods-for-calling-a-constructor-in-dotnet/).
- Christos Matskas [writes about secure and minimal APIs using .NET 6, C# 10, and Azure Active Directory](https://dev.to/425show/secure-and-minimal-apis-using-net-6-c-10-and-azure-active-directory-197i).
- Khalid Abuhakmeh [works with the PriorityQueue in .NET 6](https://khalidabuhakmeh.com/working-with-dotnet-six-priorityqueue).

### ⛅ The cloud

- Maarten Balliauw [uses custom bindings with the Azure Functions .NET isolated worker](https://blog.maartenballiauw.be/post/2021/06/01/custom-bindings-with-azure-functions-dotnet-isolated-worker.html).
- Davide Bellone [introduces using Azure Service Bus with C#](https://www.code4it.dev/blog/058-azure-service-bus-introduction).
- Théo Rémy [works on stateful serverless workflows with Azure Durable Functions](https://medium.com/asos-techblog/stateful-serverless-workflows-with-azure-durable-functions-44986abc121b).
- Thomas Maurer [runs cloud-native apps on Azure PaaS anywhere](https://www.thomasmaurer.ch/2021/06/run-cloud-native-apps-on-azure-paas-anywhere/).

### 🔧 Tools

- Abhijit Jana [switches between Git branches and repos in Visual Studio](https://dailydotnettips.com/switch-between-git-repositories-and-branches-seamlessly-in-visual-studio/) and [removes unused references in Visual Studio](https://dailydotnettips.com/remove-unused-references-clean-up-project-references-and-nuget-packages-in-visual-studio/).
- Nicholas Blumhardt [customizes Serilog text output](https://nblumhardt.com/2021/06/customize-serilog-text-output/).
- Russell Smith [gets started with the Windows Package Manager](https://petri.com/guide-getting-started-with-windows-package-manager-winget-v1-0), and Matthew MacDonald [offers his honest appraisal](https://medium.com/young-coder/winget-goes-mainstream-but-still-lags-behind-213404148206).

### 📱 Xamarin

- James Montemagno [writes about building beautiful apps with Xamarin](https://devblogs.microsoft.com/xamarin/building-beautiful-apps-with-xamarin-forms).
- Luis Matos [recaps .NET MAUI Preview 4](https://luismts.com/msbuild-dotnetmaui-preview-4/).
- Sam Basu [provides his weekly MAUI update](https://www.telerik.com/blogs/sands-of-maui-issue-10).

### 🏗 Design, testing, and best practices

- Jimmy Bogard [starts a series on domain-driven refactoring](https://jimmybogard.com/domain-driven-refactoring-intro/).
- Vladimir Khorikov [writes about nulls in value objects](https://enterprisecraftsmanship.com/posts/nulls-in-value-objects/).
- Derek Comartin [talks about the Competing Consumers Pattern](https://codeopinion.com/competing-consumers-pattern-for-scalability/).

### 🎤 Podcasts

- The Overflow [talks about observability and OpenTelemetry](https://stackoverflow.blog/2021/06/01/podcast-343-unpacking-observability-and-opentelemetry-with-spiros-xanthos-of-splunk/).
- The 6-Figure Developer podcast [talks to Cecil Phillip about Dapr](https://6figuredev.com/podcast/episode-198-dapr-with-cecil-phillip/).
- The Azure DevOps Podcast [recaps Build 2021](http://azuredevopspodcast.clear-measure.com/microsoft-build-recap-2021-episode-143), and [so does Merge Conflict](https://www.mergeconflict.fm/256).
- The No Dogma Podcast [talks to Martin Beeby about using .NET on AWS](https://nodogmapodcast.bryanhogan.net/).
- The .NET Core Podcast [talks to Tanya Janka about application security](https://dotnetcore.show/episode-77-application-security-with-tanya-janka/).

### 🎥 Videos

- The ASP.NET Monsters [deploys with GitHub Actions](https://www.youtube.com/watch?v=EOlm3ft0VPo).
- On .NET [talks about C# string interpolation](https://channel9.msdn.com/Shows/On-NET/C-Language-Highlights-String-Interpolation) and [async streams](https://www.youtube.com/watch?v=gEKph1QmEpE).
- Technology and Friends [talks to Jeff Wilcox about open source at Microsoft](https://www.davidgiard.com/2021/05/31/JeffWilcoxOnOpenSourceAndMicrosoft.aspx).
- Data Exposed [sets up Azure Monitor for SQL Insights](https://channel9.msdn.com/Shows/Data-Exposed/How-to-Set-up-Azure-Monitor-for-SQL-Insights).