xmedeko
xmedeko

Reputation: 7820

C# Settings without writing to App.config

I have C# application in VisualStudio with a SecretSettings.settings (application settings), which I do not want to write into App.config.

I do not want a plain user to read these settings from MyApp.exe.config, but I want a power user to be able to modify MyApp.exe.config, add SecretSettings section and change the application behaviour.

Everything is working fine when I manually edit App.config after every change in SecretSettings.settings and remove the settings from there. But is there any way to tell the VisualStudio to stop merging SecretSettings.settings into App.config? I am just a man and forget to correct App.config occasionally.

Upvotes: 1

Views: 160

Answers (1)

code4life
code4life

Reputation: 15794

I usually use a Visual Studio extension called Slow Cheetah or Configuration Transformation. Both are pretty good at what they do, which is to inject or modify app.config values at compile time.

https://visualstudiogallery.msdn.microsoft.com/579d3a78-3bdd-497c-bc21-aa6e6abbc859

Upvotes: 1

Related Questions