Show Notes
📢
.NET 5 has been released. As a reminder, .NET Framework 4.8 is the last, and dare I say, legacy version of .NET. .NET 5 is .NET Core 3.1 renamed to .NET, so that going forward -- at least in name, .NET is unified. .NET 6 will
actually unify all the different frameworks under the umbrella of .NET, but 5 is the aspirational name change.
As a minor note, ASP.NET Core on .NET 5 is the name for ASP.NET Core. It works, as long as you don't think about it too hard. Also "Core" is an overloaded term now. Enjoy!
🆕 With .NET 5, "
Single File Applications" are now Generally Available. A single file application is not what it sounds like because naming is hard. 'File' here means 'output file', not source code file (that will become important in a minute). With .NET 5 you can now deploy a statically linked executable that contains the runtime and everything it needs in a single file. If you've created a Go application, this is that. Also note that it appears they've now changed the name from "Single file application" to "Single file Deployment", which is a good name change in my opinion.
🆕 Also with .NET 5, you can now have a... sigh.. single
source code file application with what the .NET team calls "
Top Level Statements". Instead of the ceremony with static void main; you can just start diving in to the code and it'll just work.
🆕
System.Text.Json Aka Microsoft's "Newtonsoft Json replacement" has got some new features. If you're adopting .NET 5, you're going to want to pay attention, as Newtonsoft.Json is no longer being developed. If you are just catching up, they hired JNK about a year ago and quickly put Newtonsoft.Json out to pasture. System.Text.Json is your new replacement.
🆕
C# 9 records are now generally available. A
record is a way to effectively have an (almost) immutable DTO without all of the ceremony that DTOs used to take. If you have a property-based object with no behavior (methods), then you should
strongly consider a record.
🆕 C# 9 also brings us "enhanced pattern matching" which is a fancy phrase for "one step closer to Perl". That's great for me since I love perl, but can you imagine trying to debug this?
public static bool IsLetterOrSeparator(this char c) => c is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z') or '.' or ',';
private List<WeatherObservation> _observations = new(); var forecast = station.ForecastFor(DateTime.Now.AddDays(2), new()); WeatherStation station = new() { Location = "Seattle, WA" };
Your choice is to now either be var based or this new-fangled (sorry) new() based. We did not need another programming holy war, but it appears we're going to get it.
There are more C# 9 changes; but those are the highlights.
📢
EF Core 5 for .NET 5 has been released I can't make it through the 81+ features they've added since 3.1 without worrying for the health of the EF team, but I'll at least try to hum a few bars: Many to Many relationships, EF Core CLI, ChangeTracker.Clear, Improved Code First Scaffolding, and more. Yes,
and more.
📝
.NET IoT Libraries documentation has been published. I like this as it makes low level programming approachable with C#. I wish this had been available for me a few years ago. Instead I was stuck in the hellscape that is embedded C with tens of people in the world using bespoke Q&A sites to figure out what's going wrong.
📢
AWS Supports .NET 5 this is sort of a hand-wavy gesture because no part of me is checking the dozens of Amazon services to see if it works across all of them, but I'll take amazon's word for it.
📢
Powershell 7.1.0 has been released with support for .NET 5. There is a very small crowd that loves powershell, and I'm not about to cross them because they are zealous about their love for Powershell.
📝
Mathew McDonald ssks, does .NET 5 deliver on its promises? This is a longer read, but there are lots of good tidbits here, including one that I initially missed: Single file Applications only work on Linux. On MacOS and Windows, there is nothing 'single' about the Single File Application deployment.
Blazor:
Entity Framework:
Xamarin:
.NET 5
And lastly,
🔎 .NET Foundation removed the "Contribution Model" and later reverted that change.
No word yet on what's going on. This is an important change If you want to learn more about the .NET Foundation, I've
posted a podcast episode on the subject. There are two ways to get your project into the .NET Foundation: 1) You assign the project copyright over to them -- they know own your project, or 2) you sign an agreement to use their contribution model. This change removed option #2, leaving only the option for you to sign over your project's copyright to the .NET foundation, effectively making them the owner. This is, as we say in the biz, "Bad". I'd love to understand the reasoning behind this change so that fear uncertainty and doubt don't take over, but so far no one's talking.