Obfuscating strongly-typed configuration without breaking IOptions binding
DEV Community
Obfuscating strongly-typed configuration without breaking IOptions binding
The configuration binder maps appsettings.json and environment-variable keys to the public property names of your options POCO by reflection. Rename those properties in an obfuscation pass and the bound values silently become null or default at runtime — no compile error, no exception, just wrong behavior. This post reads exactly how `services.Configure<T>` resolves keys to property setters, what the .NET 8+ source-generated binder changes and what it does not, how to build a nebula.config.json keep-list that pins the public property names and the parameterless constructor of your options classes while renaming everything else, and how to confirm in Glass.NET that the options surface survived.
0 comments
No comments yet.