Here is my problem. I have a certain files from the solution (let's say Web.config) that I've changed and will never want to check-in since the changes are referring to my machine only. Is there a way to say in TFS to ignore changes in a certain file and remove it from pending changes window. Of course, I can skip this file in every check-in, but there is always a change to forget and check-in by mistake. For example, there is a similar ignore list in AnkhSVN.
Some parts of {app,web}.config
files can be delegated to another file. Notably <connectionStrings>
.
In your app.config
or web.config
:
<connectionStrings configSource="LocalConnectionStrings.config" />
in LocalConnectionStrings.config
have (<connectionStrings>
is the root element):
<connectionStrings>
<!-- For the application's operations. -->
<add name="Application"
connectionString="Data Source=server;Initial Catalog=database;Integrated Security=True;Network Library=dbmssocn"
providerName="System.Data.SqlClient" />
</connectionStrings>
Thus each developer has a LocalConnectionStrings.config
which is in the project, but not in source control set with their private settings while the {web,app}.config
has shared settings. Unfortunately this only works with a limited set of system defined configuration elements.
One workaround could be to remove the readonly attribute on the web.config in the windows explorer then edit it in notepad:
Ugly but simple solution.
The best practice concerning configuration files, TFS and different developer machines is (hem hem)...
All your developers should have the same dev environment. It's the only way to manage web.config files in TFS, and it has a lot of added benefits:
Nomore "but it work on my computer"
its friend the dreaded "I don't understand what dependencies are required. It doesn't compile anymore."
You won't regret the famous "Ah! I forgot to tell you, I invented a MyWonderfullApplicationConfigSection and you should define it in your web.config, but I won't tell you how."
It will really help setting up a build environment or a deployment.
Ok, it isn't really easy, I know that different developers like different settings... but it's a good idea to standardize the dev platform. It's really worth it.
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