The .NET Stacks #51: 👷‍♂️ The excitement is Build-ing
Tags: dotnet, azure, csharp
Published: 2021-05-29 12:31:18

---
title: The .NET Stacks #51: 👷‍♂️ The excitement is Build-ing
published: true
date: 2021-05-29 12:25:00 UTC
tags: dotnet,azure,csharp
canonical_url: https://www.daveabrock.com/2021/05/29/dotnet-stacks-51/
---

_NOTE: This is the web version of my weekly newsletter, released on May 24, 2021. To get the issues right away, subscribe at_ [_dotnetstacks.com_](https://dotnetstacks.com/) _or the bottom of this post._

Happy Monday! I hope you're all doing well.

Here's what's going on this week:

- **The big thing**: Previewing the big week ahead
- **The little things**: SecureString meeting its demise, the .NET Coding Pack, web dev news
- Last week in the .NET world

* * *

## The big thing: Previewing the big week ahead

This week will be a big one: we've got Microsoft Build—probably the last virtual one—which kicks off on Tuesday. In what is surely not coincidental timing, .NET 6 Preview 4 should also be released. (And if that isn't enough, _The .NET Stacks_ turns 1 next Monday. Please, no gifts.)

While Build doesn't carry the same developer excitement as it has in the past, in my opinion—the frenetic pace of .NET keeps us busy throughout the year, and, to me, Build has shifted toward a marketing event. Still, it'll be nice to watch some sessions and see where things are going. You can check out the sessions [on the Build website](https://mybuild.microsoft.com/home).  I'll be keeping an eye on [a .NET 6 deep dive](https://mybuild.microsoft.com/sessions/70d379f4-1173-4941-b389-8796152ec7b8?source=sessions), [microservices with Dapr](https://mybuild.microsoft.com/sessions/a5648d1d-b523-4549-a2bc-a0ad226cfe2a?source=sessions), and an Ask the Experts panel [with many Microsoft .NET folks](https://mybuild.microsoft.com/sessions/43aba346-543e-4180-9b70-fff940935906?source=sessions).

Next week, we'll also see the release of .NET 6 Preview 4 (finally!). While we'll pore over some of it next week when its formally communicated, [the "what's new" GitHub issue](https://github.com/dotnet/core/issues/6098) really filled up this week and has some exciting updates.

### New LINQ APIs

.NET 6 Preview 4 will include [quite a few new LINQ APIs](https://github.com/dotnet/core/issues/6098#issuecomment-825157960).

#### Index and Range updates

LINQ will now see Enumerable support for `Index` and `Range` parameters. The `Enumerable.ElementAt` method will accept indices from the end of the enumerable, like this:

```csharp
Enumerable.Range(1, 10).ElementAt(^4); // returns 7
```

Also, an `Enumerable.Take` overload will accept `Range` parameters, which allows you to slice enumerable sequences easily.

#### MaxBy and MinBy

The new `MaxBy` and `MinBy` methods allow you to use a key selector to find a maximum or minimum method, like this (the example here is taken from the issue):

```csharp
var people = new (string Name, int Age)[] { ("Tom", 20), ("Dick", 30), ("Harry", 40) };
people.MaxBy(person => person.Age); // ("Harry", 40)
```

#### Chunk

A new `Chunk` method allows you to chunk elements into a fixed size, like this (again, taken from the issue):

```csharp
IEnumerable<int[]> chunks = Enumerable.Range(0, 10).Chunk(size: 3); // { {0,1,2}, {3,4,5}, {6,7,8}, {9} }
```

### New DateOnly and TimeOnly structs

We talked about this in a past issue, but we'll see [some new](https://github.com/dotnet/core/issues/6098#issuecomment-840815510)`DateOnly`[and](https://github.com/dotnet/core/issues/6098#issuecomment-840815510)`TimeOnly`[structs](https://github.com/dotnet/core/issues/6098#issuecomment-840815510) that add to `DateTime` support and do not deprecate what already exists. They'll be in the `System` namespace, as the others are. For use cases, think of `DateOnly` for business days and birthdays and `TimeOnly` for things like recurring meetings and weekly business hours.

### Writing DOMs with System.Text.Json

So, this is fun: Preview 4 will bring us [the ability to use a writable DOM feature](https://github.com/dotnet/core/issues/6098#issuecomment-840857013) with `System.Text.Json`. There's quite a few use cases here. A big one is when you want to modify a subset of a large tree efficiently. For example, you'll be able to navigate to a subsection of a large JSON tree and perform operations from that subsection.

There's a lot more with Preview 4. Check out [the GitHub issue](https://github.com/dotnet/core/issues/6098) for the full details. We'll cover more next week.

* * *

## The little things: SecureString meeting its demise, the .NET Coding Pack, general web dev news

The `SecureString` API _seems_ great, it really does. It means well. It allows you to flag text as confidential and provide an extra layer of security. The main driver is to avoid using secrets as plain text in a process's memory. However, this doesn't translate to the OS, even on Windows. Except for .NET Framework, array contents are passed around unencrypted. It does have a shorter lifetime, so there's that—but it isn't that secure. It's easy to screw up and hard to get right.

The .NET team has been trying to phase out `SecureString` for awhile in favor of a more flexible `ShroudedBuffer<T>` type. This [issue comment](https://github.com/dotnet/designs/pull/147#issuecomment-844392771) has all the juicy details of the latest updates.

* * *

This week, Scott Hanselman wrote about [the .NET Coding Pack for Visual Studio Code](https://www.hanselman.com/blog/introducing-the-net-coding-pack-for-vs-code-getting-started-with-c-for-beginners). The pack includes an installation of VS Code, the .NET SDK (and adding it to the PATH), and a .NET extension. With the .NET Coding Pack, beginners will be able to work with .NET Interactive notebooks to quickly get started.

* * *

While we mostly talk about .NET around here, I think it's important to reach outside our bubble and keep up with web trends. I came across two interesting developments last week.

Google has decided to no longer give Accelerated Mobile Pages (AMP) preferential treatment in its search results (and they are even [removing the icon](https://plausible.io/blog/google-amp) from the results page). Whatever the reason—its controversy, lack of adoption, or Google's anti-trust pressure—it's a welcome step for an independent web. (Now, [if only they'd bring back Google Reader](https://www.cnet.com/news/google-may-be-resurrecting-google-reader-inside-chrome-with-follow-button/).)

In other news, StackBlitz—in cooperation with Google Chrome and Vercel—has launched WebContainers, [a way to run Node.js natively in your browser](https://blog.stackblitz.com/posts/introducing-webcontainers/).  Simply put, it's providing an online IDE. Thanks to the strides WebAssembly has made in the past few years, it's paved a way for a WASM operating system.

Under the covers, it includes a virtualized network stack that maps to the browser's ServiceWorker API, which enables offline support. It provides a leg up over something like Codespaces or various REPL solutions, which typically need a server. I take exception [with StackBlitz saying](https://blog.stackblitz.com/posts/introducing-webcontainers/#what-about-code-spaces%2Fsandbox%2Frepls%2F...%3F) those solutions "provide a worse experience than your local machine in nearly every way" ... but if you do any JavaScript work, this is an exciting development (especially when dealing with JS's notoriously cumbersome tooling and setup demands).

* * *

## 🌎 Last week in the .NET world

### 🔥 The Top 3

- Jeremy Likness [works with Azure Cosmos DB, EF Core, and Blazor Server](https://blog.jeremylikness.com/blog/azure-cosmos-db-with-ef-core-on-blazor-server/).
- Matthew MacDonald asks: [will Canvas rendering replace the DOM?](https://medium.com/young-coder/the-future-web-will-canvas-rendering-replace-the-dom-847be872884c)
- Eve Turzillo [organizes and modifies existing HTTP and HTTPS requests with Fiddler](https://www.telerik.com/blogs/how-to-organize-and-modify-existing-http-https-requests).

### 📢 Announcements

- Tara Overfield [discusses the .NET Framework Cumulative Update for May](https://devblogs.microsoft.com/dotnet/net-framework-may-2021-cumulative-update-preview).
- The Azure SDK team [recaps the May release](https://devblogs.microsoft.com/azure-sdk/azure-sdk-release-may-2021).
- Khalid Abuhakmeh [writes about dotMemory support for Linux process dumps](https://blog.jetbrains.com/dotnet/2021/05/18/dotmemory-support-for-linux-process-dumps/).

### 📅 Community and events

- Microsoft Build [kicks off Tuesday](https://mybuild.microsoft.com/home). David Ramel [previews Build 2021](https://visualstudiomagazine.com/articles/2021/05/20/build-2021.aspx), and Richard Hay [links to some digital swag](https://www.windowsobserver.com/2021/05/20/microsoft-build-2021-digital-swag-downloads/). Also, the Visual Studio team [previews their Build sessions](https://devblogs.microsoft.com/visualstudio/the-visual-studio-family-welcomes-you-at-microsoft-build-2021).
- The .NET Foundation [Outreach Committee announces a new proposal process](https://dotnetfoundation.org/blog/2021/05/19/wg-outreach-proposals).
- The .NET Docs Show [talks to Steve Gordon about ElasticSearch.NET](https://www.youtube.com/watch?v=Ll5yLL83W8M).
- A busy week with community standups: ASP.NET [talks about accessibility](https://www.youtube.com/watch?v=5ceTua82w4s), Entity Framework [builds modern apps with GraphQL](https://www.youtube.com/watch?v=4k3WzW2ZdXs), and [.NET Tooling discusses container tools](https://www.youtube.com/watch?v=FZGhYEwsJ9k).

### 🌎 Web development

- Tomasz Pęczek [receives JSON Objects Stream (NDJSON) in ASP.NET Core MVC](https://www.tpeczek.com/2021/05/receiving-json-objects-stream-ndjson-in.html).
- Paul DeVito [continues writing about building an event-driven .NET app](https://wrapt.dev/blog/building-an-event-driven-dotnet-application-setting-up-masstransit-and-rabbitmq).
- Anoop Kumar Sharma [writes about cookie authentication in ASP.NET Core](https://www.c-sharpcorner.com/article/cookie-authentication-in-asp-net-core/).
- StackBlitz introduces WebContainers, which provide [the ability to run Node.js natively in your browser](https://blog.stackblitz.com/posts/introducing-webcontainers/).
- Adam Storr [defines HttpClient test requests by using a bundle](https://adamstorr.azurewebsites.net/blog/defining-httpclient-test-requests-by-using-a-bundle).
- Davide Bellone [exposes a .NET assembly version from API endpoint routing](https://www.code4it.dev/blog/assembly-version-via-api-endpoint-routing).
- Kirtesh Shah [introduces ASP.NET Core Razor Pages](https://www.c-sharpcorner.com/article/introduction-to-asp-net-core-razor-pages/).
- Damien Bowden [secures OAuth bearer tokens from multiple identity providers in ASP.NET Core](https://damienbod.com/2021/05/17/securing-multiple-identity-provider-oauth-bearer-tokens-in-an-asp-net-core-api/).
- Matthew Jones [uses custom user message extension methods in C# and MVC](https://exceptionnotfound.net/custom-user-message-extension-methods-in-csharp-and-dotnet-5-mvc/).

### 🥅 The .NET platform

- Konrad Kokosa asks: [why should you care about .NET GC?](https://tooslowexception.com/why-should-you-care-about-net-gc/)
- Khalid Abuhakmeh [works with .NET console host lifetime events](https://khalidabuhakmeh.com/working-with-dotnet-console-host-lifetime-events).
- Richard Lander [writes about profile-guided optimization (PGO) in .NET 6](https://devblogs.microsoft.com/dotnet/conversation-about-pgo).
- Nick Randolph [writes about the future of Windows development](https://www.infoq.com/articles/future-windows-other-platforms-development/).

### ⛅ The cloud

- Muhammed Saleem [creates business workflows with Azure Logic Apps](https://code-maze.com/creating-business-workflows-with-azure-logic-apps/).
- Abhijit Jana [explains how](https://dailydotnettips.com/the-fastest-way-to-get-started-with-microsoft-azure/)to get started with Azure quickly.
- Daniel Krzyczkowski [continues his series on Azure Identity](https://daniel-krzyczkowski.github.io/Lost-In-Azure-Cloud-Identity-Serie-Part5/).
- John Reilly [uses Azurite and Table Storage in a dev container](https://blog.johnnyreilly.com/2021/05/15/azurite-and-table-storage-dev-container/).

### 📔 Languages

- Georg Dangl [updates the Azure App Service on Linux for Docker with C# webhooks](https://blog.dangl.me/archive/updating-azure-app-service-on-linux-for-docker-via-webhooks-from-c/).
- Rick Strahl [finds a gotcha with the C# null ? propagator when doing async/await](https://weblog.west-wind.com/posts/2021/May/15/Async-Await-with-the-Null-Propagator).
- Munib Butt [uses Azure Blob Storage in C#](https://www.c-sharpcorner.com/article/using-azure-blob-storage-in-c-sharp/).
- Akash Mair [writes about data exploration in F#](https://www.compositional-it.com/news-blog/data-exploration-in-f/).

### 🔧 Tools

- Abhijit Jana [uses GitHub Actions from Visual Studio](https://dailydotnettips.com/ci-cd-using-github-actions-workflow-directly-from-visual-studio/).
- Maarten Balliauw [writes about the Rider NuGet Credential Provider for JetBrains Space private repos](https://blog.jetbrains.com/dotnet/2021/05/20/rider-nuget-credential-provider-for-jetbrains-space-private-repositories/).
- Charles Flatt [recaps the git commit/checkout process](https://www.softwaremeadows.com/posts/git_commit_checkout_is_a_snapshot__not_a_delta/).

### 🏗 Design, testing, and best practices

- Dennis Martinez [writes about 5 ways to speed up your end-to-end tests](https://www.telerik.com/blogs/5-ways-to-speed-up-your-end-to-end-tests).
- Niels Swimberghe [bypasses ReCaptcha's in Selenium UI tests](https://swimburger.net/blog/dotnet/how-to-bypass-recaptchas-in-selenium-ui-tests).
- Scott Brady [writes about authenticated encryption in .NET with AES-GCM](https://www.scottbrady91.com/c-sharp/aes-gcm-dotnet).
- Derek Comartin [talks about testing your domain when event sourcing](https://codeopinion.com/testing-your-domain-when-event-sourcing/).
- Christian Heilmann [says you can't automate accessibility testing](https://christianheilmann.com/2021/05/17/you-cant-automate-accessibility-testing/).

### 🎤 Podcasts

- Scott Hanselman [talks to Rey Bango about developers and security](https://www.hanselminutes.com/789/developers-and-security-with-rey-bango).
- The Azure DevOps Podcast [talks to Jeremy Likness about working with data in .NET](http://azuredevopspodcast.clear-measure.com/jeremy-likness-on-working-with-data-on-net-episode-141).
- The .NET Core Show [talks about dotnet new3 With Sayed Hashimi](https://dotnetcore.show/episode-76-dotnet-new3-with-sayed-hashimi/).
- The 6-Figure Developer podcast [talks to Rich Lander about .NET 6 Preview](https://6figuredev.com/podcast/episode-196-net-6-preview-with-rich-lander/).

### 🎥 Videos

- Learn Live [continues learning about Git](https://channel9.msdn.com/Shows/Learn-Live/Learn-Git-Episode-4-Visual-Studio-Code-and-GitHub?WT.mc_id=DOP-MVP-4025064).
- The Let's Learn .NET series [talks about building accessible apps](https://www.youtube.com/watch?v=ttxAYDMKtSs).