Can I create app.config or web.config file that applies only to my developer machine, as opposed to using the default configuration files that are checked into source control?Answer1:
You can have an app.config for each environment, if is this what you are looking for. Try this: <a href="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx" rel="nofollow">http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx</a>Answer2:
I would recomend using separate config files that are referred to by your app.config or web.config.
For example in your web.config you would have:
<configuration> <appSettings file="Config/LocalDev.config"> </appSettings> </configuration>
And then in Config/LocalDev.config you would have
<appSettings> <add key="SomeKey" value="SomeValue"/> <add key="AnotherKey" value="AnotherValue"/> </appSettings>
You would also create a Config/Production.config file with your production settings. Then all you have to do is edit the appSettings file in your web.config when you deploy.Answer3:
To do this, you need to exclude <em>web.config</em> or <em>app.config</em> from source control.Answer4:
What I would recommend doing is checking in an "app.config.backup" file whilst ignoring all app.configs. This will allow you to modify your own app.config accordingly without interfering with other developer's machines, whilst at the same time allowing for updates to the existing "base" configuration.Answer5:
Depending on what exactly you are trying to achieve, you may find <a href="http://msdn.microsoft.com/en-us/library/ms229697.aspx" rel="nofollow">Machine.config</a> helpful.Answer6:
Use a copy of web.config named web.svn.config to be under source control.
That way, the source-controlled config file (web.svn.config) contains all required settings, and each developer can maintain their own config files (web.config) on their dev machines.Answer7:
If you want configuration that applies only to your machine and each developer will likely be doing the same thing then you can do as we do and have only a minimum configuration in the web.config that is part of the solution and the rest in your global web.config or machine.config (if you need to also have some desktop apps use it). We do this to create an isolated environment between dev/qa/staging/prod and it is still easy to push from one environment to the next without having to edit the config files or worry about overwriting them. We also further isolate our environments by include host file entries that only allow machines in dev communicate with others at the same level. Likewise for qa/staging/prod.