Rick
2.7K posts


Make your first game now with .NET and MonoGame x.com/i/broadcasts/1…




Injecting settings in .NET? You have 3 main interfaces to choose from. But picking the wrong one means your app might completely ignore your config changes. Here is the simple breakdown: 1️⃣ IOptions • Read once at startup. • Cached for the entire lifetime of the app. • Perfect for static settings that never change. 2️⃣ IOptionsSnapshot • Re-evaluated on every single request. • Picks up appsettings.json changes without restarting your app. • Perfect for web APIs (Scoped lifetime). 3️⃣ IOptionsMonitor • Real-time updates. • Triggers an event exactly when a setting changes. • Perfect for background services (Singleton lifetime). The Rule of Thumb: Use IOptions for static config. Upgrade to IOptionsSnapshot in web apps. Reach for IOptionsMonitor when you need change notifications in background workers. Want a deeper dive into how the Options Pattern works under the hood? Read my full breakdown here: milanjovanovic.tech/blog/how-to-us… Which of these three do you find yourself using the most? --- Tired of writing the same boilerplate code for every new project? Skip the setup and start building features immediately with my Clean Architecture template: milanjovanovic.tech/templates/clea…











But you used them. A testament to @dotnet's greatness. Despite the government's best attempts, the devs still shipped something and it survived over the years.






