Category: MSDN: Essential .NET

.NET Reunified – Microsoft’s Plans for .NET 5 (MSDN)

When Microsoft announced .NET 5 at Microsoft Build 2019 in May, it marked an important step forward for developers working across desktop, Web, mobile, cloud and device platforms. In fact, .NET 5 is that rare platform update that unifies divergent frameworks, reduces code complexity and significantly advances cross-platform reach. This is no small task. Microsoft […]

Essential .NET: Parse the Command Line with System.CommandLine (MSDN)

Parsing the Command Line Going all the way back to. NET Framework 1.0, I’ve been astounded that there’s been no simple way for developers to parse the command line of their applications. Applications start execution from the Main method, but the arguments are passed in as an array (string[] args) with no differentiation between which […]

Tuple Trouble: Why C# Tuples Get to Break Guidelines

Trouble With Tuples Back in the August 2017 issue of MSDN Magazine I wrote an in-depth article on C# 7.0 and its support for tuples ( At the time I glossed over the fact that the tuple type introduced with C# 7.0 (internally of type ValueTuple<…>) breaks several guidelines of a well-structured value type, namely: […]

Essential .NET: C# 8.0 and Nullable Reference Types

Nullable Reference Types Overview Nullable reference types—what? Aren’t all reference types nullable? I love C# and I find the careful language design fantastic. Nonetheless, as it currently stands, and even after 7 versions of C#, we still don’t have a perfect language. By that I mean that while it’s reasonable to expect there will likely […]

Essential .NET: Custom Iterators with Yield

Yield Return Statements In my last column, I delved into the details of how the C# foreach statement works under the covers, explaining how the C# compiler implements the foreach capabilities in Common Intermediate Language (CIL). I also briefly touched on the yield keyword with an example (see Figure 1), but little to no explanation. […]

C# Foreach Internals and Custom Iterators With Yield

Foreach Statement This month I’m going to explore the internals of a core construct of C# that we all program with frequently—the foreach statement. Given an understanding of the foreach internal behavior, you can then explore implementing the foreach collection interfaces using the yield statement, as I’ll explain. Although the foreach statement is easy to […]

Essential MSBuild-A Build Engine Overview for .NET Tooling

Exploring the .NET Core Build System Those of you who have been following .NET Core over the past few years (has it been that long?) know all too well that the “build system” has experienced a significant amount of flux, whether it be dropping built-in support for gulp or the demise of Project.json. For me […]

Essential .NET: PowerShell Just Keeps Getting Better

Improvements of PowerShell PSGallery Untrusted As a result, Find-Module works without issue. However, Install-Module will prompt you with an untrusted repository warning. To avoid this, assuming you do indeed trust the repository, you can set it to trusted with the command: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Apt-Get for Windows with PowerShell Package Management Those of […]