Thomas Ardal

Thomas Ardal

Denmark
201 posts
Debugging System.AccessViolationException - DllImport hell

For this post in the series Debugging common .NET exceptions, I'll present an exception that will be uncommon for most of you and cause recurring nightmares for the rest: System.AccessViolationException. The exception typically happens when unmanaged code tries to read or write from/to memory that hasn't been allocated ...

Debugging System.AggregateException - even in async code

We are here once again to help you debug common .NET exceptions. This time I want to help you debug the rather generic System.AggregateException. As the name implies, AggregateException is used to batch one or more exceptions together in a single exception. In this post, I'll show you why ...

The ultimate guide to connection strings in web.config

Connection strings in web.config can be both powerful and challenging. The times were you would just remote desktop to production and change settings inside your ASP.NET web.config file is long gone. So, should you keep specifying connection strings using the connectionStrings element in web.config? Stay tuned ...

log4net Tutorial - The Complete Guide for beginners and pros

log4net is still one of the most commonly used logging frameworks for .NET. While originally being a port of the log4j logging framework for Java, a lot has happened over the years, to make log4net a unique logging option for .NET/C# developers. This post is a collection of descriptions, ...

Debugging System.UnauthorizedAccessException (often followed by: Access to the path is denied)

It's time for another post in our series about Debugging common .NET exceptions. Today, I want to introduce you to System.UnauthorizedAccessException. The exception is typically caused by an IO error, but other issues like security restrictions are also known to utilize this error. Let's dig in!Handling the errorCatching ...

Web.config customErrors element with ASP.NET explained

The CustomErrors element inside an ASP.NET/MVC/Web API Web.config file, is something almost everyone uses somehow, however, many people’s experiences don’t work like they expect. During my years coding primarily ASP.NET MVC, I've used the custom errors element again and again. I have also ...

Issue Tracking 2.0

You may remember our quest to introduce light-weight issue tracking capabilities in elmah.io. If not, check out Mark errors as fixed, dashboards and more. Last week we silently launched the next chapter. Before I go into details about the new features, I want to put a few words on ...

Serilog vs log4net

Serilog and log4net are two very popular choices for logging messages from .NET applications. In this post, I'll show you how to configure and use each framework as well as list the advantages and disadvantages of each framework. I even dare to recommend you use one of the frameworks :)Let's ...

Debugging System.IO.FileNotFoundException - Cause and fix

This is the third part in the series named Debugging common .NET exceptions. Today, I want to help you track down and fix a very common and very well known exception, System.IO.FileNotFoundException. Admitted! In all instances this error is caused by trying to access a file that isn't ...