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
Deploy Access Restricted Azure website from DevOps Pipelines

Solves deploying to an IP-restricted Azure website from Microsoft-hosted Azure DevOps agents, whose IPs are dynamic, by calling Invoke-RestMethod against ifconfig.me/ip, exposing the result as a CurrentIp output variable, then using an Azure PowerShell task to add that IP to Access Restrictions. ...

Creating Visual Studio extensions using Roslyn analyzers

Builds a Visual Studio extension, published as elmahio.cronexpressions on the marketplace, using an Empty VSIX Project and the IAsyncQuickInfoSourceProvider/IAsyncQuickInfoSource APIs to show a human-readable Quick Info tooltip on hover, powered by the CronExpressionDescriptor 2.19.0 NuGet package. ...

Creating and downloading zip files with ASP.NET Core

Implements a /downloadzip ASP.NET Core MVC endpoint using ZipArchive.CreateEntryFromFile inside a MemoryStream returned via File(), then shows a temp-file alternative with Path.GetTempFileName to avoid holding large zips in memory, plus mentions SharpZipLib and DotNetZip as external NuGet options. ...

Logging and global error handling in .NET 7 WPF applications

Modernizes a .NET 7 WPF app's startup by removing App.xaml's StartupUri and adding a Program.cs that builds a Host via Host.CreateDefaultBuilder from Microsoft.Extensions.Hosting, registers App and MainWindow as singletons, and injects an ILoggerFactory into MainWindow for logging. ...

Build and publish Visual Studio extensions with GitHub Actions

Builds a GitHub Actions workflow on windows-latest for a VS extension using nuget/setup-nuget and microsoft/setup-msbuild, then auto-increments the patch version via PowerShell, replacing 1.0.0 with a run-number suffix across the vsixmanifest, AssemblyInfo.cs, and the extension class file. ...

Polling asynchronous APIs with Azure Durable Functions

Implements an Azure Durable Functions orchestration polling a fictional generate-large-file API: a TimerTrigger starter calls StartNewAsync hourly, needing a manual Microsoft.Azure.WebJobs.Extensions.DurableTask 2.8.1 reference, then chains activity functions polling until status flips to done. ...

Best Chrome extensions for web developers

An alphabetical list of Chrome extensions the elmah.io team relies on: 1Password, Allow CORS for injecting Access-Control-Allow-Origin headers, Awesome Screenshot and Screen Recorder, BuiltWith Technology Profiler, elmah.io's own Dark Screen of Death, EditThisCookie, Grammarly, and JSONVue. ...

How to generate header images for blogs and ASP.NET Core

Automates blog header-image generation with Bannerbear: designs a Template with a dynamic message text layer, generates images via a POST to the Bannerbear API or its Simple URLs feature, then wires the result into the twitter:image meta tag alongside twitter:card summary_large_image. ...

Built-in rate limiting in ASP.NET Core vs AspNetCoreRateLimit

Compares ASP.NET Core 7's built-in Microsoft.AspNetCore.RateLimiting middleware against the AspNetCoreRateLimit package by implementing an api_key-based policy using GetFixedWindowLimiter capped at 10 requests per hour, and overriding RejectionStatusCode to 429 instead of the default 503. ...