C# – Parsing commands and arguments in a console app

In a console app there are two ways to get commands: Command line arguments passed into your program via Main(string[] args). User input from Console.ReadLine() (which you then split into a string[]). After getting a command, you have to parse it to figure out what code to execute. Typically commands have the following format: commandName … Read more C# – Parsing commands and arguments in a console app

How to add User Secrets in a .NET Core console app

The User Secrets feature in .NET Core is a safe, simple way to override values in appsettings.json. The overridden values only exist in a file sitting in your own dev environment, so you don’t accidently commit them to your source control repository. This feature is enabled in ASP.NET by default, and the framework does most … Read more How to add User Secrets in a .NET Core console app

NLog – split trace logging into its own file

This article explains how to configure NLog so that trace-level log messages go to their own file. This approach only requires modifying the nlog.config file, and doesn’t require any code changes. In the end, all levels above Trace – Debug, Error, Warn, Info – will go into one log file and all trace-level messages will … Read more NLog – split trace logging into its own file

ASP.NET – Use Swagger to generate API documentation

The simplest way to add API documentation is to use Swagger. You can configure it to generate an API documentation page and even send requests to your endpoints. Here’s what it looks like: In this article I’ll show how to install and configure Swagger with the following features (shown in the image above): Generates an … Read more ASP.NET – Use Swagger to generate API documentation

OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory

Problem I’m trying to use Selenium with the ChromeDriver and I’m running into the following exception: Unhandled Exception: OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html Solution The simplest solution is to install the Selenium.Chrome.WebDriver nuget … Read more OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory