I am part of a small team developing a web project in VS2013 with TFS2010 for source control.
When we are working from home, as we all do from time to time, we need to have a slightly different version of the web.config file. Previously, when we were using VSS, we could just make the file read/write which enabled us to keep a local copy that didn't get checked back into source control. TFS is too smart to let us do that with the inevitable result that occasionally somebody accidentally checks the wrong version back in.
Can anyone suggest a good way for us to deal with this issue?
There is an answer here that might work for you, using a .tfignore
file.
However you may not want to completely exclude web.config, as it may be useful to share the appsettings section between your team, and maybe you would prefer to only exclude the connection strings section. If so, you could use an external config file for your connection strings only, then exclude that using the .tfignore
technique.
This means your web.config would contain something like this:
<?xml version='1.0' encoding='utf-8'?>
<configuration>
<connectionStrings configSource="connections.config"/>
</configuration>
and your (excluded) connections.config file would look like this:
<connectionStrings>
<add name="Name" providerName="System.Data.ProviderName" connectionString="xxx" />
</connectionStrings>
Edit: I just noticed you mentioned TFS2010, so the .tfignore
method is not an option (unless you upgrade to TFS2012 or higher). There is an answer here that supports TFS2010, using the Forbidden Patterns Policy - which should work for you, assuming you can install the TFS Power Tools.