Shows how to test a locally hosted ASP.NET Core site running on IIS Express from a real phone using Ionut-Cristian Florescu's iisexpress-proxy npm tool (e.g. npx iisexpress-proxy 44302 to 80), skipping app.UseHttpsRedirection() outside IsDevelopment, and finding your LAN IP with ipconfig findstr. ...
Walks through replacing ASP.NET Core Identity with manual cookie authentication in Startup.cs, configuring AddAuthentication and AddCookie, wiring up UseAuthentication/UseAuthorization, and building a login form that signs in via a ClaimsPrincipal. ...
Announces elmah.io Heartbeats and shows the ASP.NET Core integration: installing Elmah.Io.AspNetCore.HealthChecks, calling AddElmahIoPublisher with an ApiKey, LogId, and HeartbeatId, then scheduling hourly health checks via HealthCheckPublisherOptions. ...
Demonstrates two ways to export data to Excel from an ASP.NET Core controller: generating a CSV file manually with StringBuilder and the File helper, and creating a real XLSX spreadsheet with the ClosedXML NuGet package's XLWorkbook and Worksheet APIs, compared briefly to EPPlus and OpenXml. ...
Announces that elmah.io's legacy v2 API, used by all Elmah.Io.* client packages versioned 2.x and deprecated three years earlier for lacking API key security, will be shut down on June 1, 2020, and explains how to disable v2 access from the Actions tab of your log settings before then. ...
Covers NLog end to end for C#: the six log levels (Fatal down to Trace), getting a Logger via LogManager.GetCurrentClassLogger(), the fluent logging API, structured logging with Properties, and configuring targets - NLog ships with almost 100, from the console and SQL Server to elmah.io. ...
Shows how to wire up CSRF protection for AJAX calls in ASP.NET Core: registering AutoValidateAntiforgeryTokenAttribute as a global MVC filter, rendering a token with @Html.AntiForgeryToken(), and forwarding it as a RequestVerificationToken header on every jQuery POST, PUT, and DELETE via ajaxSend. ...
Replaces ASP.NET's discontinued WebImage class with the SixLabors.ImageSharp NuGet package in ASP.NET Core: accepting an upload via IFormFile, loading it with Image.Load(file.OpenReadStream()), resizing to a fixed 256x256 with image.Mutate(x => x.Resize(256, 256)), then saving the result. ...
Updates a classic ASP.NET MVC security-headers guide for ASP.NET Core: setting headers via middleware (app.Use) or a web.config customHeaders block on IIS, covering X-Frame-Options (DENY vs SAMEORIGIN), AddAntiforgery's SuppressXFrameOptionsHeader, and the deprecated X-Xss-Protection header. ...