How to write a stateful Roslyn analyzer
I wrote a stateful Roslyn analyzer a couple of days ago to analyze the codebase at work for irregularities, and I thought I would share my findings on how I did it.
Blog posts tagged by C#
I wrote a stateful Roslyn analyzer a couple of days ago to analyze the codebase at work for irregularities, and I thought I would share my findings on how I did it.
This blog post looks at automatically generating an HTTP API client from a OpenAPI specification (formerly swagger) using AutoRest.
I've been writing a lot of CLI apps, both at work and in my free time, and there's never really been a command line parsing framework that has fitted my needs. While being either too complex or too simple, it's always nagged me that I need to write so much code myself. What I wanted was a way to be declarative about my commands, options and arguments while still allowing composition of them.
I've been doing some WPF development the last couple of weeks, and one thing that bugged me was that there is no way (as far as I know) to bind content to a RichTextBox. This makes it kind of difficult to follow the MVVM pattern since the view model needs intimate knowledge of the view.
Ever wanted to display things conditionally in XAML based on a pre-processor directive like `DEBUG`?
I was reading Andrew Lock's excellent blog post about Creating parameterised tests in xUnit when I remembered something I wrote a while back that has proven to be quite useful.
Yesterday I encountered a bug in a library I'm working on that only seemed to occur when compiled in release mode.
In this blog post I will show you how to use Cake with your AppVeyor CI builds.
Cake supports something called script aliases. Script aliases are convenience methods that are easily accessible directly from a Cake script. Every API method in Cake is implemented like this.
I have during my nine years as a (professional) programmer used several different build automation systems such as Rake, psake, CMake, TFS Build and FAKE, but none of these have allowed me to write my build scripts using C# - the language I use the most.
A while back I had to read string data written by .NET's BinaryWriter in C++. I was initially a little bit confused about how the data was written but after using Reflector it turned out that the write method prefixes the string with a 7-bit encoded integer.
Something I've seen a lot at different clients is naive string comparison. The most common case is to do something involving String.ToLower() on both strings that are being compared and then an equality comparison of the result.
Yesterday I was working on some unit tests that ensured that some user derived classes passed to a method were decorated with a specific attribute.