Solution build configuration – create – configure – use in C#
20-Jun-1919 Leave a comment
- Debug and Release are predefined
- When in Debug – check if “Define DEBUG constant” is checked
- Use Solution -> Configuration Manager to create other configurations
- Use Project Properties – Build (Side) Tab – To add/edit Conditional compilation symbols
- Use in C#
#if DEBUG
jsonFileName = “appsettings.Development.json”;
#elif STAGING
jsonFileName = “appsettings.Staging.json”;
#else
jsonFileName = “appsettings.json”;
#endif - Easy to change config on VS top tool bar