Category: Programming
-
HTTP Error 500.30 – ASP.NET Core App Failed to Start on IIS: Simple Things to Check First
I recently hit this error after moving an application from classic ASP.NET / .NET Framework hosting over to ASP.NET Core on IIS: HTTP Error 500.30 – ASP.NET Core app failed to start The page showed the usual Microsoft message: Common solutions to this issue:The app failed to startThe app started but then stoppedThe app started…
-
Angular Nginx Hosting Trouble shooting Guide
1. Initial Request Flow Client → Port 5020 → Nginx Container (Port 80) → /usr/share/nginx/html → Angular App Check Points & Why: # 1. Is port accessible? curl -v localhost:5020 # Checks if nginx is listening docker compose ps # Verify port mapping: “5020:80” # 2. Is nginx running? docker compose logs nginx # Check…
-
Database Targeting Debugging in ASP.NET Core
Overview We tracked down a user-role issue that looked like a permissions problem, but the real cause was database targeting. One user could sign in and get roles. Another user with apparently similar data could sign in but did not get the expected roles. At first glance this looked like: Those were all worth checking,…
-
Connection String FAQ
This page explains a common ASP.NET Core pattern where the app does not keep its main database connection string in appsettings.json. Instead, startup code retrieves the value from Azure Key Vault and inserts it into the normal .NET configuration tree before the rest of the app runs. What does the startup code actually look like? The…
-
System.Text.Json 8.0.0.4 Vulnerability: A Solution
I was facing a very strange issue where after updating a NuGet package (System.Text.Json from 8.0.0.4 to 8.0.0.5) and targeting .NET Framework 4.8.1, the project wouldn’t build correctly. Despite updating the bindingRedirect in the web.config file, the changes seemed to revert. Here’s what worked for me: Note on Entity Framework Compatibility: It’s essential to ensure…
-
Avoiding Syntax Errors with the Conditional Operator in C#
I was having a strange bug in my code, everything looked right, but for some reason, it just wouldn’t work as expected. I had written a simple conditional statement using the ternary operator, but it kept throwing a syntax error. I scratched my head, wondering what could be causing the issue. The code in question…
-
Two-Way Data Binding with Dates: A Common Gotcha
I was having issues getting dates to bind. I realised that when the data came down as a string, the data binding worked fine, but when it came down as a date object, the binding failed. At first, I thought it was a problem with my Angular code, but it turned out to be a…
-
Web.config transforms and git. Ending the frustration.
In the world of MVC projects, managing web.config transformations can often be a tricky task, especially when working with source control systems like Git. A common issue that developers face is that every time a web transform is run, the web.config file changes are being tracked by Git. This can be frustrating as these changes are made before runtime…
-
Building a Dockerized C# Email Tester: A Step-by-Step Guide 📧🐳👨💻
As developers, we often need to test email functionality in our applications. But how can we do that efficiently, especially when working with Docker containers? In this tutorial, I’ll walk you through the process of creating a Dockerized C# Email Tester. We’ll cover everything from setting up the project to sending test emails—all within a…
-
Creating a component and adding it to an existing module.
Sometimes when creating a component, we want it to exist under a module to keep things structured and so that our app module doesn’t get huge. It can also provide other benefits like lazy module loading and some nice other features. So that others know, the important thing here is that the file name of…