Does anyone know how to get the current build configuration $(Configuration)
in C# code?
To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.
The Runtime Configurator feature lets you define and store data as a hierarchy of key value pairs in Google Cloud Platform. You can use these key value pairs as a way to: Dynamically configure services. Communicate service states. Send notification of changes to data.
You can change and save these using the ConfigurationManager . You can modify and save user settings without restarting. You can't do that with application settings.
If you unload your project (in the right click menu) and add this just before the </Project>
tag it will save out a file that has your configuration in it. You could then read that back in for use in your code.
<Target Name="BeforeBuild">
<WriteLinesToFile File="$(OutputPath)\env.config"
Lines="$(Configuration)" Overwrite="true">
</WriteLinesToFile>
</Target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With