asp.net - Select web.config or app.config Connection String based on Machine Name -


this question, loosely relates choose settings based on machine name asked previously, have more specific use it, hoping baked .net default.

i 1 of several people in small team writing dotnet desktop , web applications. use git source repository, , becomes tiresome have change .config file connection strings each of development environments.

i know there several ways overcome problem; range not storing .config files in repo in first place (and using .gitignore), through writing code parse configuration file manually adding prefixes etc suggested in other question.

however, seems both overly simplistic , tedious; in production environment there may lots of legitimate reasons store multiple connection strings in config file - such having several servers - makes me think there has easier way it.

so question this: is there way in dotnet .config files have multiple connection strings framework 'automatically' knows 1 load based on property, such environment or machine name?

a question clarity: there config transforms not meet requirement? setup active solution configuration based on build configuration manager settings (environment) , replace nodes needed. time web, console, , service projects. suited web (built-in) , others (with minor post build tweaking).


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -