Exception filters in C# 6: their biggest advantage is not what you think
Explains the key advantage of C# 6 exception filters: they preserve the call stack for debugging by not unwinding it when a filter condition fails.
Thomas Levesque is a French software developer and long-time .NET expert with 20 years of experience, specializing in C#, ASP.NET Core, and open-source development. He is a core maintainer of FakeItEasy and a former Microsoft MVP.
109 articles from this blog
Explains the key advantage of C# 6 exception filters: they preserve the call stack for debugging by not unwinding it when a filter condition fails.
A guide to creating an auto-mocking Unity container extension using FakeItEasy to simplify unit testing with complex dependencies.
How to add async and cancellation support to .NET WaitHandle synchronization primitives using extension methods.
Explains how to use ReSharper's code annotation attributes to improve static analysis and code quality in C# development.
A C# programming puzzle testing understanding of the 'out' parameter keyword and variable assignment.
Explores advanced C# 6 string interpolation, covering IFormattable conversion for custom formatting like culture control and URL encoding.
Explores writing asynchronous unit tests in NUnit, comparing async void vs. async Task methods and detailing NUnit 2.6's internal handling.
Introducing XamlAnimatedGif, a new open-source library for displaying animated GIFs in WPF, Windows Store, and Windows Phone apps with improved memory efficiency.
Explains performance issues with ToArray/ToList and proposes a custom extension method to optimize them by providing the element count.
A guide to converting file sizes to human-readable formats, covering conventions like SI, IEC, and customary, and introducing the HumanBytes library.
Explores C# string interpolation and a custom StringTemplate library for named placeholders, useful for localization and readability.
Explains a workaround for passing parameters by reference to async methods in C# using a custom Ref<T> class.
A method to automate unit testing for null argument validation, reducing repetitive test code for methods with multiple parameters.
A developer shares a tip about a minor bug in Visual Studio Online's Git integration with Team Explorer and provides a workaround.
A developer's hands-on review of NDepend, a static analysis tool for .NET, covering setup, UI, and its powerful CQLinq-based rule engine.
A guide to implementing system-wide global hotkeys in WPF applications using the NHotkey library, directly from XAML.
Explains how to handle timeout issues when uploading large files using HttpWebRequest in .NET, offering a solution with custom synchronous wrappers.
Explains how to implement a 'push' model for uploading data with HttpClient in .NET, contrasting it with the default 'pull' model.
A tutorial on implementing long-press item selection for WinRT ListView and GridView controls to improve user experience.
Introducing AutoRunCustomTool, a Visual Studio extension that automatically runs custom tools when dependent files are modified, solving a common T4 template workflow issue.