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
Creating custom debug visualizers for Visual Studio 2022

Builds a Visual Studio 2022 debug visualizer named MailAddressVisualizer for System.Net.Mail.MailAddress, using the Microsoft.VisualStudio.Extensibility.Sdk 17.8.13-preview NuGet package, a VisualStudioContribution ExtensionEntrypoint class, and a DebuggerVisualizerProvider on net6.0-windows. ...

9 "hidden" features in Visual Studio that you may not know

Lists nine lesser-known Visual Studio tricks: dragging a project onto another in Solution Explorer to add a reference, the GitHub Actions node for .github YML workflows, the built-in CPU/memory profiler in the Diagnostics window, indentation-preserving copy since VS 17.7, and /rootsuffix profiles. ...

Parsing websites in C# with Html Agility Pack or AngleSharp

Builds a Spectre.Console CLI that scrapes book titles and prices from the test site books.toscrape.com using both HtmlAgilityPack (100M+ NuGet downloads) and AngleSharp (nearly 70M), showing HtmlDocument.SelectNodes XPath queries like //article[@class=product_pod] to pull data from the DOM. ...

Building and deploying AWS email templates with Azure DevOps

Sets up an Azure DevOps YAML pipeline with Npm@1 and gulp@0 tasks to build an MJML/Handlebars.js template into template.json, then uses the AWS Tools extension's AWSCLI@1 task to run ses create-template and upload it to AWS SES, flagging that create-template only succeeds on the first run. ...

Building MJML email templates with Gulp

Writes a three-task Gulp pipeline, mjml-to-html, update-json, and run, built with the gulp-mjml, html-minifier, and gulp-json-editor npm packages, that converts an MJML template into minified HTML and injects it into the HtmlPart property of an AWS SES template.json file. ...

Creating AWS email templates with Handlebars.js and MJML

Introduces elmah.io's approach to AWS SES email templates: pairing Handlebars.js expressions like {{firstname}} and {{#each movies}} with MJML, the Mailjet-built XML markup that compiles to cross-client HTML, and why sending just a template name plus data cuts outbound Azure-to-AWS traffic costs. ...

Normalize and compare URLs with C#

Implements a NormalizeUrl string extension used in elmah.io's error-uniqueness detection: it strips query strings, fragments, and trailing slashes via Split(?,#), then uses LINQ to replace any path segment parsing as an int, Guid, or DateTime with 0, so /product/{guid}/view URLs compare equal. ...

How to get the client IP in ASP.NET Core even behind a proxy

Explains how ASP.NET Core exposes client IP via HttpContext.Connection.RemoteIpAddress or the injectable IHttpContextAccessor (registered with AddHttpContextAccessor), then shows why Cloudflare or another reverse proxy overwrites RemoteIpAddress with its own IP, and how to recover the real IP. ...

Turn a Hue light red when website is down with IFTTT & elmah.io

Wires elmah.io Uptime Monitoring to a Philips Hue Play Light Bar via an IFTTT webhooks applet: an elmah.io Rules-tab rule fires an HTTP request on the Uptime message condition, POSTing a JSON body with the $severityHex helper variable as value1 so IFTTT turns the Hue light red or green. ...