Thomas Ardal

Thomas Ardal

Meet Thomas, the founder and developer behind elmah.io. Thomas blogs about everything technical from C# and ASP.NET Core to machine learning.

Denmark
313 posts
Effective Error Logging in Windows Forms Applications with C#

Error logging is an essential part of any application, as it allows developers to track and fix issues that may arise during the use of the application. In a Windows Forms application written in C#, several options exist for implementing effective error logging. In this blog post, we will discuss ...

The ultimate guide to secure cookies with web.config in .NET

TOC This is the fourth post in a series about ASP.NET security. Check out Improving security in ASP.NET MVC using custom headers, Content-Security-Policy in ASP.NET MVC, and Storing Content-Security-Policy reports in elmah.io for more security-related posts. You've already heard about cross-site scripting (XSS), right? ...

Find anomalies with spike detection and ML.NET

We recently started experimenting with machine learning on elmah.io. There's a closed beta on anomaly detection and more, similar features will follow in the future. We chose ML.NET as the framework and are pretty happy with the results so far. The amount of documentation is good ...

Debugging System.NullReferenceException - Object reference not set to an instance of an object

TOC Time for another post in the series Debugging common .NET exceptions. Today's exception is, without a doubt, the error most people have experienced: System.NullReferenceException. The exception happens when you try to invoke a reference that you were expecting to point to an object but in fact, ...

How to write to a file with C# - StackOverflow doesn't get it right

TOC Today's tip isn't exactly about a hot new version of ASP.NET Core or anything like that. I often find myself googling "simple" questions like how to write text to a file in the quickest and effective way. Most results are either blog ...

C# exception handling best practices

I'm getting near my 20th anniversary in the tech industry. During the years, I have seen almost every anti-pattern when dealing with exceptions (and made the mistakes personally as well). This post contains a collection of my best practices when dealing with exceptions in C#. Don't ...

Fix max URL and query string length with web.config and IIS

I had a problem the other day that I believe qualifies as a blog post. An elmah.io user reported that refreshing the organization overview would generate a 404. After debugging the problem, I found out that the URL generated by that page can be too long. This post is ...

OAuth authentication with Facebook and ASP.NET Core

The aim of this post is to teach you how to implement Identity Authentication & Authorization with ASP.NET Core. We will begin with a cookie-cutter Microsoft starter project, and then modify it to use Kendo in a future post. First Things First First, I'll walk you through ...

Partner with BrowserStack to support real-device debugging

Since writing this post the BrowserStack integration has been removed. When dealing with client-side errors, the combination of a physical device, the operating system, and the browser can be the cause of an error. You probably don't have an old Samsung Galaxy S4 running Android 4 laying in ...