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
How to download files from ASP.NET Core MVC

Covers the Content-Disposition response header behind file downloads, then compares ASP.NET Core's four IActionResult types - FileContentResult, FileStreamResult, PhysicalFileResult, VirtualFileResult - with a working File() example in an MVC HomeController. ...

How to get base URL in ASP.NET Core

Builds a BaseUrl() HttpRequest extension method using UriBuilder to strip default ports cleanly, then shows how to reach the same request data from Razor Pages by registering IHttpContextAccessor in Program.cs. ...

Three NuGet packages to improve exceptions in .NET/C#

Introduces Xeption for enriching custom exceptions via UpsertDataList and ThrowIfContainsErrors, Ben.Demystifier's Demystify method for readable stack traces, and Polly's Policy.Handle/Retry for resilient HTTP calls. ...

elmah.io launches two GitHub Actions in the GitHub Marketplace

Announces elmah.io's GitHub Technology Partner status and two new GitHub Actions: elmahio/github-create-deployment-action for deployment tracking and elmahio/github-upload-source-map-action for de-minifying JavaScript stack traces on release. ...

Building a quick Reddit Blazor client without Reddit's API

Builds a Blazor WebAssembly Reddit client that skips Reddit's OAuth-gated API entirely, instead querying the Elasticsearch-backed pushshift.io search API from a RedditClient.razor page with a live search field and results table. ...

Deploying a MkDocs documentation site with GitHub Actions

Walks through a GitHub Actions workflow (main.yml) that runs on ubuntu-latest, checks out code with actions/checkout@v2, installs Python via actions/setup-python@v2, installs MkDocs with pip, and deploys via mkdocs gh-deploy --force --clean --verbose on every push to the main branch. ...

Hosting a MkDocs-driven documentation site on GitHub Pages

Explains how to publish a MkDocs site to GitHub Pages by pushing a local git repo to GitHub and running mkdocs gh-deploy, which builds the static site straight into a gh-pages branch GitHub Pages auto-deploys, plus why the generated site folder belongs in .gitignore, not version control. ...

Creating a documentation site with MkDocs

Introduces MkDocs, the Python-based static site generator, showing how to install it with pip, scaffold a site via mkdocs new, preview it locally with mkdocs serve on port 8000 with live reload, add pages through the nav section in mkdocs.yml, and apply the mkdocs-material theme. ...

Building a Stack Overflow browser as a VS extension

Walks through building a Visual Studio extension (VSIX) named StackOverflowBrowser that adds a tool window, StackOverflowToolWindow, with a XAML UI holding a query textbox, search button, and WebBrowser control, then wires up a StackOverflowClient class to query the Stack Overflow API. ...