I recently ran into an issue using HttpClient in ASP.NET Core and the built-in
Dependency Injection system. This post aims to highlight what I found, what I
believe the issue was, and how I was able to get my app working again.
I’m a huge fan of command-line utilities (aka, console apps). In general, I
find console apps to have much lower barriers to use than traditional
window-based systems: in many respects, they’re much easier to build than other
alternatives (such as Windows Forms and Windows Presentation Foundation apps),
with generally lower barriers to entry. That said, I hate writing argument
parsers. It’s not that it’s super-difficult, but it’s tedious, and for such a
common task, I’d really like to use a library. I’m aware of a few, and found
what is easily my favorite recently, CommandLineParser. In this
post, I’ll explore what my preferences are, and why I’ve recently selected this
one as the default when starting new .NET projects. I’ll also explore how I go
about selecting new dependencies for projects that I’m working on.
Have you ever been nervous about making a change to an application, or
interested in benchmarking your code in order to demonstrate the efficacy of
a proposed change? I recently wanted to change the behavior of a core piece of
application code, but wanted to be sure that it was going to be an improvement
to the system, beyond simplifying the mental model for the code. To justify my
changes, I spent time measuring them, using a tool called
BenchmarkDotNet.