Accessing Tuples at Runtime using Reflection

C# 7 added Tuples and provides an awesome syntax for accessing them. C# 7.1 improved the usability of tuples further with Tuple Name Inference. However, sometimes you need to access them dynamically and this can be tricky.

Read More

Upgrading ASP.NET Libraries to .NET Standard

.NET Standard is great; .NET Standard is an interface that allows you to write libraries once and consume them from different applications on different .NET platforms, including ones that don't even exist yet.

Standalone libraries are often straightforward to upgrade to .NET Standard, but what about …

Read More

ASP.NET Core - A Complete Rewrite of ASP.NET

ASP.NET Core 2.0 was released alongside Visual Studio 2017.3 and is ready for use, but its relationship with prior frameworks is often misunderstood and can be confusing.

Many people seem to think ASP.NET Core is simply the next version of ASP.NET MVC. However, it is so much more than that, it is a replacement and …

Read More

Upgrading to .NET Core and .NET Standard Made Easy

With the release of .NET Core 2.0 and .NET Standard 2.0, now is a great time to consider upgrading your projects to .NET Core and your libraries to .NET Standard.

By upgrading your projects to .NET Core 2.0 you get cross-platform support and higher performance. By upgrading your libraries to .NET Standard you get greater compatibility and ensure they can be used in projects targeting …

Read More

Understanding .NET Standard - An Interface Not An Implementation

With so many different platforms, standards, and frameworks, how do you make sense of it all? There is .NET Framework, .NET Core, and .NET Standard before you even get to Mono and Xamarin.

What is the difference, which do I need, what is .NET Standard? When do I use .NET Standard? If you're confused, then you're not alone and this post is for you.

In this post, I explain .NET …

Read More

What is .NET? Framework or Platform?

You'll often hear the terms framework and platform used interchangeably. This can be very confusing. You'll hear that .NET Core is a platform. Then you'll read that .NET Core is cross-platform. Next, you'll learn that .NET Core is a framework. And it doesn't help that framework is part of the name of the original full .NET Framework.

In this post, I explain …

Read More

Maximizing Throughput - The Overhead of 1 Million Tasks

I recently needed to choose between two competing designs: a simple one that needed millions of tasks or a complex one that needed only a few processing threads.

Plan A was to leverage the power of Task-based asynchronous programming in .NET to create a simple solution that had tasks waiting on a mix of other tasks, timers, events, and more; but, it would need millions of tasks, all …

Read More

Gotchas with HttpClient's CancelPendingRequests and Timeout in .NET

HttpClient provides a convenient way to make web requests in .NET. But if you want to cancel all pending requests using CancelPendingRequests or use the Timeout functionality, you must be aware of the gotchas.

I recently encountered some strange behaviour where some requests were not cancelled when CancelPendingRequests was called and …

Read More