Hardening ASP.NET Response Headers (Code) A reliable way to harden your ASP.NET web application is to remove and skew the response headers via code. This will throw off automated scans that are performing banner grabbing in an attempt to identify vulnerabilities. There are ways to do this in IIS, however, performing this in code means it's applied everywhere that the...
Mounting Volumes in Docker with Visual Studio This technique is ideal for local development within Visual Studio. You can easily mount local files into a docker container by modifying the MSBuild commands of the project. Project File's MSBuild Commands This code came from a .NET Core 3.1 project. Using MSBuild Variables Another way to do this is to use the MSBuild Variable $(MSBuildStartupDirectory). Since...
Kubernetes: ConfigMaps with .NET
Kubernetes ConfigMaps with .NET Core This tutorial will cover how to mount a Kubernetes ConfigMap into a pod and how to read that configuration in .NET. I will also demonstrate the different ways a .NET application can read configuration from an appsettings.json file. One demonstration will reload configuration on change and how to listen for those changes. That does not...
.NET Core Interview Questions Q: What is .NET Core? .NET Core is a modern Microsoft framework for creating applications that can run platform agnostic. .NET core has performance gains over its predecessor technology ASP.NET where it's been shown as 2400% times faster. .NET core can handle up to 7,000,000 HTTP requests per second. .NET core is developed in C++ and C#. https://en.wikipedia.org/wiki/.NET_Core https://www.ageofascent.com/2019/02/04/asp-net-core-saturating-10gbe-at-7-million-requests-per-second/ Q:...
.NET Core: Dynamically Return Style Sheets with Web API If you have a need to dynamically return a stylesheet to the UI here's a quick tutorial on how to do it. Header Template C# Web API
Repository Pattern (C#) There are some really good articles out there about the repository pattern but I haven't seen one that strongly demonstrates different data providers, sample code, or some of the tricks I've learned. I primarily build internal business applications so I've used this pattern at almost every .NET job I've ever had. It's very common and I've learned...
.NET: Unit Testing Azure Service Bus Unit testing an Azure Service Bus consumer is fairly easy. In this tutorial, I will use .NET6, Moq (v4), and Fluent Assertions. The difficult part is constructing the ServiceBusMessageReceived because it has only internal constructors and no interface. However, there is a factory service that can create these objects. GitHub I've included unit testing in this...
Local Development with Azure API Management Gateway This was rather tricky to figure out so I thought I would share my experience with setting up Visual Studio with a local development subscription of Azure API Management (APIM) Gateway. It turns out that running a local copy of the Azure API Management Gateway is possible through either Docker or Kubernetes. Since...
IdentityServer: Token Exchange This custom Token Exchange Grant Flow allows IdentityServer to exchange a reference token through the creation of a new JWT token. There are many reasons why this may need to be done. The documentation on this process isn't as clear and I thought it would help others if I shared what I learned and experienced. We'll also use...
C# Reflection: Application Name & Version My friend Christian Caspers showed me this trick and I thought it was a great idea. I've always saved these values in a configuration file but this little snippet is great for pulling that information from the assembly file. View Gist on GitHub
Jamie Bowman
Software Architect

WEATHER

St Louis
clear sky
72.9 ° F
76.3 °
69.4 °
78 %
2.2mph
0 %
Tue
87 °
Wed
82 °
Thu
81 °
Fri
83 °
Sat
78 °

FOLLOW ME

354FollowersFollow
16SubscribersSubscribe

Random article