Builds a GitHubContentService in ASP.NET Core that uses HttpClientFactory to call GitHub's contents API, decodes the Base64-encoded response, converts Markdown to HTML with Markdig, and caches results for an hour via IMemoryCache to avoid hitting GitHub's API rate limit. ...
Implements a MyExceptionHandler class using ASP.NET Core's IExceptionHandler interface, then writes a full-pipeline integration test with NUnit and WebApplicationFactory against a /throw endpoint to verify the middleware returns the expected 500 JSON, instead of mocking HttpContext directly. ...
Runs Retire.js, a CLI vulnerability scanner by Erlend Oftedal, against an ASP.NET Core 3.1 MVC project's wwwroot libraries to catch a jquery-validation 1.17.0 ReDoS flaw (CVE-2021-21252), then wires the same scan into an Azure DevOps build via a custom extension so vulnerable JS fails the pipeline. ...
Walks through adding code coverage to an Azure DevOps YAML pipeline for .NET 9: install the coverlet.collector NuGet package, enable XPlat Code Coverage in a DotNetCoreCLI@2 test task, then use ReportGenerator to turn the raw XML into a readable report published as a build artifact. ...
Collects concrete HttpClient recipes for .NET: set a User-Agent with ParseAdd, enable GZip/Deflate AutomaticDecompression on HttpClientHandler, disable SSL validation via ServerCertificateCustomValidationCallback, send typed payloads with PostAsJsonAsync/GetFromJsonAsync, and add Polly retries. ...
Recounts why elmah.io moved from Google reCAPTCHA to Cloudflare Turnstile after reCAPTCHA shifted to Google Cloud, then shows the ASP.NET Core integration: a Managed-mode widget in the Cloudflare dashboard, wiring turnstile.render with a site key and token callback, and passing the token on submit. ...
Details NuGet packages elmah.io added since its last stack review: Azure.AI.OpenAI and Microsoft.SemanticKernel for its Bugster chatbot, the Azure.* rewrite (Azure.Storage.Blobs, Azure.Messaging.ServiceBus), HtmlAgilityPack for uptime's canonical checker, and IPNetwork2 for CIDR-based IP filtering. ...
Revisits ASP.NET Core 8's HTTP logging: setting up AddHttpLogging and UseHttpLogging, merging separate request/response log entries into one message via the new CombineLogs option, and writing a custom IHttpLoggingInterceptor called IgnoreLoggingInterceptor to skip noisy .css and .js requests. ...
Breaks down a NullReferenceException stack trace line by line - exception type, message, the three-space call stack indentation, and file/line source info - then moves into combining inner and aggregate exceptions. ...