Reputation: 25523
I have a project I'm working on where I have a team that is located in two different locations. We are using a source control system that integrates with VS 2008. We have created a solution folder where we store different web.config files so the different locations can pick and choose which configuration they need to use to run the project.
What I would like to be able to do is have the Web Project we are working on have a web.config file in the project, but be ignored by the source control system. The source control system we're using is SourceGear, and it is operating under its default configuration, which is very reminiscent of VSS to me. I would like to avoid having to exclude the web.config file from the project, but I don't see any other way without the source control system constantly trying to add the file back into the repository.
How can I ignore the web.config file with respect to my source control system without having to exclude the file from my project all together?
Upvotes: 2
Views: 1824
Reputation: 585
Although my answer is not specific to source control, one thing you may want to consider is adding custom config sections to your web.config, and retrieving a different configuration depending on the location (server it is deployed on).
I do this currently to deal with deployment to staging, testing, production servers. My configuration classes will determine what the server name is, and retrieve the configuration settings for that particular server. That way, I don't have to worry about touching the web.config again, or excluding it and using different files.
Here is an article on how to do this. Yes it is not exactly what you asked, but may be better than relying on source control and using different config files.
https://web.archive.org/web/20210802144254/https://aspnet.4guysfromrolla.com/articles/032807-1.aspx
Upvotes: 2
Reputation: 88092
Look into the Cloaking feature of sourcegear. The only downside is that it is a user-specific setting so everyone on the team would have to comply.
Upvotes: 2