Simple zero-downtime updates with ASP.NET Core and health checks
Do you use a load balancer that isn’t tightly integrated with your orchestrator and therefore doesn’t know upfront when the orchestrator has to stop an instance of your ASP.NET Core application for an upgrade / a scaling action / a restart?
Does this result in a few failing requests until the load balancer has finally figured out that the instance is gone?
If so, this blog post might be for you!
Using Flutter flavors to separate the DEV and LIVE environment
These are the requirements for our app:
- Our Flutter app should target iOS and Android.
- We want a DEV version and a LIVE version of our app, each targeting a different API URL.
- Developers should never have to manually change any code to switch between the environments.
- We want to be able to have the DEV app and the LIVE app installed on the same device at the same time.
The best way to solve these requirements in Flutter is to use flavors. There are also some other tutorials for this linked on the official Flutter docs which might be helpful.
The code for this guide is stored on GitHub and changes for each section are separate commits that are linked in the section below.
Find missing projects with PowerShell
Find projects which are missing in your "All Projects" solution
Feature Folders: Controllers and Views
The first step in our process to a better folder structure for our MVC projects is to make sure, MVC can resolve our Controllers and Views. This is our target structure:
- (Project Root)
- Areas
- (AreaName)
- (FeatureName)
- (FeatureName)Controller.cs
- Index.cshtml
- Edit.cshtml
- … (other features)
- Shared
- … (area specific shared views like EditorTemplates, Layout-pages, …)
- (FeatureName)
- … (other areas)
- Shared
- … (area independent shared views like EditorTemplates, Layout-pages, …)
- (AreaName)
- Features
- (Feature2Name)
- (Feature2Name)Controller.cs
- Index.cshtml
- Edit.cshtml
- … (other features)
- Shared
- … (feature independent shared views like EditorTemplates, Layout-pages, …)
- (Feature2Name)
- Areas
Of course, if you don’t want to use “areas” you only need the “Features” folder in your project. This also means, that if you move to this new structure, you can completely remove the old “Controllers” and “Views” folders.