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
Upload and resize an image natively with ASP.NET Core 🖼️

Resizes an uploaded IFormFile to 256x256 using only System.Drawing.Common's Image.FromStream and Bitmap classes - no ImageSharp needed - then saves the bytes to disk with a FileStream as a simple alternative for basic scenarios. ...

Show a name and profile photo with .NET and Gravatar 🤵

Shows a Gravatar avatar from just an email address using an MD5 hash extension method and the gravatar.com/avatar/HASH URL, including a robohash fallback for missing accounts, then calls Gravatar's JSON API from C# to fetch name and photo data server-side. ...

Introducing Breadcrumbs

Announces elmah.io's new Breadcrumbs feature with launch-day support in Elmah.Io.AspNetCore, Elmah.Io.JavaScript, and Elmah.Io.Xamarin, showing manual AddBreadcrumb calls plus the TreatLoggingAsBreadcrumbs option for automatic Microsoft.Extensions.Logging capture. ...

Create a colored CLI with System.CommandLine and Spectre 🎨

Builds FART (File Association and Rename Tool), a sample CLI using System.CommandLine's RootCommand and nested rename Command with required --input/--output options, then layers in Spectre.Console for colored terminal output. ...

Adding CAPTCHA on form posts with ASP.NET Core 🚦

Adds reCAPTCHA v2 to an ASP.NET Core Identity ForgotPassword.cshtml page to block bots from mass-triggering reset emails: scaffolding the page, embedding the g-recaptcha widget with a site key, then verifying the token server-side through a wrapped HttpClient. ...

Pretty print/syntax highlight .NET stack traces in a browser ✨

Turns an unformatted .NET stack trace in a pre/code block into pretty-printed, syntax-highlighted output using the jQuery-based netstack.js library and its st-type, st-method, and st-file CSS classes for custom styling. ...

Subscribe users to a Mailchimp newsletter from .NET/C# 📧🐵

Adds a newsletter checkbox to ASP.NET Core Identity's Register.cshtml, wiring the MailChimp.Net.V3 package's IMailChimpManager to call Members.AddOrUpdateAsync with Status.Subscribed or Pending for double opt-in, plus notes on handling API timeouts. ...

We are looking into GitHub Sponsors (and you should too)

Names the first five developers elmah.io sponsors through GitHub Sponsors and why: Patrik Svensson for Spectre.Console, Chris Patterson for Topshelf, Ben Adams for Ben.Demystifier, Dave Brock for The .NET Stacks newsletter, and Niels Swimberghe's blog. ...

Avoid password reuse with Pwned Passwords and ASP.NET Core 🔒

Shows how to block breached passwords in an ASP.NET Core signup flow using the PwnedPasswords.Client NuGet package, wiring up AddPwnedPasswordHttpClient with Polly retry and timeout policies, then checking HasPasswordBeenPwned before creating the user. ...