Quantcast
Channel: Andrew Lock | .NET Escapades
Browsing all 743 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

Using multiple instances of strongly-typed settings with named options in...

ASP.NET Core has used the Options pattern to configure strongly typed settings objects since before version 1.0. Since then, the feature has gained more features. For example ASP.NET Core 1.1...

View Article


Image may be NSFW.
Clik here to view.

The dangers and gotchas of using scoped services in IConfigureOptions

The configuration system in ASP.NET Core allows you to load key-value pairs from a wide variety of sources such as JSON files, Environment Variables, or Azure KeyVault. The recommended way to consume...

View Article


Image may be NSFW.
Clik here to view.

Configuring named options using IConfigureNamedOptions and ConfigureAll

This is a follow on to my previous post on using multiple instances of strongly-typed settings in ASP.NET Core 2.x. At the end of that post I introduced the concept of named options which were added...

View Article

Image may be NSFW.
Clik here to view.

Delaying strongly-typed options configuration using PostConfigure in ASP.NET...

In this post I describe a scenario in which a library author wants to use the Options pattern to configure their library, and enforce some default values / constraints. I describe the difficulties...

View Article

Image may be NSFW.
Clik here to view.

Simplifying dependency injection for IConfigureOptions with the...

In recent posts I've been discussing the Options pattern for strongly-typed settings configuration in some depth. One of the patterns that has come up several times is using IConfigureOptions<T>...

View Article


Image may be NSFW.
Clik here to view.

Creating singleton named options with IOptionsMonitor

In recent posts I've been discussing some of the lesser known features of the Options system in ASP.NET Core 2.x. In the first of these posts, I described how to use named options when you want to...

View Article

Image may be NSFW.
Clik here to view.

Generating .editorconfig files automatically using IntelliCode

In this post I show how to install the experimental IntelliCode extension in Visual Studio, and how to use it to generate an EditorConfig file from your existing code. Background I was catching up on...

View Article

Image may be NSFW.
Clik here to view.

Caching Docker layers on serverless build hosts with multi-stage builds,...

In this post I describe how I improved the build performance of my ASP.NET Core Docker containers when building on a serverless host that doesn't provide any layer caching. I used a combination of...

View Article


Image may be NSFW.
Clik here to view.

Secure secrets storage for ASP.NET Core with AWS Secrets Manager (Part 1)

An important aspect of running ASP.NET Core apps in the cloud is how you secure the secrets your app requires, things like connection strings and API keys. In this post, I show one approach to...

View Article


Image may be NSFW.
Clik here to view.

Secure secrets storage for ASP.NET Core with AWS Secrets Manager (Part 2)

In my last post, I showed how to add secrets to AWS Secrets Manager, and how you could configure your ASP.NET Core application to load them into the .NET Core configuration system at runtime. In this...

View Article

Image may be NSFW.
Clik here to view.

Why is string.GetHashCode() different each time I run my program in .NET Core?

This post is part of the second annual C# Advent. Check out the home page for up to 50 C# blog posts in December 2018! In this post I describe a characteristic about GetHashCode() that was new to me...

View Article

Image may be NSFW.
Clik here to view.

Dark mode now available!

🎵 I am a man who walks alone And when I'm walking a dark road At night or strolling through the park When the light begins to change I sometimes feel a little strange A little anxious, when it's dark....

View Article

Image may be NSFW.
Clik here to view.

Creating a git repo with Azure Repos and trying out Git LFS

I was recently working on a side project that seemed like it would have lots of large, binary assets. Unfortunately, that's just the sort of thing Git struggles with. As an experiment, I decided to...

View Article


Image may be NSFW.
Clik here to view.

Creating an AWS policy for calling the SES mailbox simulator from CodeBuild

This isn't a long, or especially interesting post, it just describes something I needed to do the other day, and couldn't explicitly find anywhere that described how to do it. As the title suggests,...

View Article

Image may be NSFW.
Clik here to view.

Using dependency injection with Twilio SMS and ASP.NET Core 2.1

ASP.NET Core is built with first-class support for dependency injection (DI). It's used heavily by the framework, but you can also use it with your own classes. The Twilio C# helper libraries are...

View Article


Image may be NSFW.
Clik here to view.

Built in options for running async tasks: Running async tasks on app startup...

This is the first post in the series: Running async tasks on app startup in ASP.NET Core. Part 1 - Built in options for running async tasks (this post) Part 2 - Two approaches for running async tasks...

View Article

Image may be NSFW.
Clik here to view.

Two approaches for running async tasks: Running async tasks on app startup in...

This is the second post in the series: Running async tasks on app startup in ASP.NET Core. Part 1 - Built in options for running async tasks Part 2 - Two approaches for running async tasks (this post)...

View Article


Image may be NSFW.
Clik here to view.

Feedback on async task examples and another possible solution: Running async...

This is the third post in the series: Running async tasks on app startup in ASP.NET Core. Part 1 - Built in options for running async tasks Part 2 - Two approaches for running async tasks Part 3 -...

View Article

Image may be NSFW.
Clik here to view.

Using health checks to run async tasks in ASP.NET Core: Running async tasks...

This is the fourth post in the series: Running async tasks on app startup in ASP.NET Core. Part 1 - Built in options for running async tasks Part 2 - Two approaches for running async tasks Part 3 -...

View Article

Image may be NSFW.
Clik here to view.

Reducing initial request latency by pre-building services in a startup task...

This post follows on somewhat from my recent posts on running async startup tasks in ASP.NET Core. Rather than discuss a general approach to running startup tasks, this post discusses an example of a...

View Article
Browsing all 743 articles
Browse latest View live