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
320 posts
Web.config location element demystified

Explains web.config hierarchy: a subfolder like /sub/ can override root appSettings, shown with a Message key returning Frontpage vs Subpage, then shows how a location path=Sub element folds that override into a single web.config, plus the allowOverride attribute for locking settings down. ...

Web.config redirects with rewrite rules - https, www, and more

Explains IIS URL Rewrite syntax in web.config, from generating rules through IIS Manager's Add Rule wizard to the resulting XML, covering inbound/outbound rules for trailing slashes, www redirects, and forcing HTTPS. ...

Instant errors on SMS from ASP.NET Core with Twilio and elmah.io

A Twilio cross-post walking through wiring up SMS error alerts for an ASP.NET Core 2.2 MVC app: signing up for elmah.io, grabbing the API key and Log ID, installing the Elmah.Io.AspNetCore NuGet package, and configuring the Twilio integration in Startup.cs. ...

Web.config transformations - The definitive syntax guide

A deep dive into XDT (XML Document Transform) syntax for Web.config transformations, covering xdt:Transform attributes like RemoveAttributes, SetAttributes, and Replace, plus a step-by-step example of swapping an appSettings value based on solution configuration. ...

Debugging System.AccessViolationException - DllImport hell

Reproduces System.AccessViolationException from a buggy DllImport'd C++ function, then shows why a plain try/catch misses it and how HandleProcessCorruptedStateExceptionsAttribute or the legacyCorruptedStateExceptionsPolicy web.config setting can make the catch block fire. ...

Debugging System.AggregateException - even in async code

Forces a System.AggregateException with Task.WaitAll on two failing tasks, then shows how to unpack InnerExceptions with the AggregateException.Handle helper, plus why old-style HttpClient calls using Wait/task.Result surface HttpRequestException wrapped this way. ...

The ultimate guide to connection strings in web.config

Covers the connectionStrings element in web.config from the basics through ConfigurationManager and Entity Framework's base("myConnection") constructor, then details SQL Server-specific settings like Integrated Security, Connection Timeout, and username/password authentication. ...

log4net Tutorial - The Complete Guide for beginners and pros

A comprehensive log4net tutorial covering the ILog interface and LogManager.GetLogger, the five log levels (Debug through Fatal), logging exceptions with log.Error, and using log4net contexts to attach shared properties across messages. ...

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

Reproduces System.UnauthorizedAccessException with File.Delete on a read-only file, rules out lookalikes like IOException and DirectoryNotFoundException, then covers fixes: clearing FileAttributes.ReadOnly, running elevated, IIS app pool identity, and Windows service Log On users. ...