-1

I am working with a project (shared by a small team via SourceSafe source control) with four .config files in it:

App.config, App.Debug.config, App.Integration.config, and App.Release.config

  • App.config is the configuration file that is eventually used when the program is executed.
  • The other three files are essentially templates that I can quickly copy & paste into App.config.
  • App.Integration.config and App.Release.config are valid for all team members. For instance, it refers to integration or production database servers on the network.
  • App.Debug.config is a template with settings that are valid only for my machine, e.g. because it refers to my local copy of a development database.

Background: Why am I managing multiple configuration files manually? ASP.NET web projects automatically support multiple configuration files, but other project types don't. I also know that this could be automated by adding a custom MSBuild task to the project file; however, this might break or confuse later build steps, such as ClickOnce deployment.

Obviously, I do not want to check in "my" local version of App.Debug.config into SourceSafe, which is why I told Source Safe to ignore that file. For the same reason, I have SourceSafe ignore App.config, because that file is often going to be edited, e.g. when switching from the local configuration file to the integration environment's version. If everyone checked in their versions of these files, they would be seen by all other developers.

However, if I understand correctly, this leads to SourceSafe no longer keeping a copy of these files at all, so if someone checks out a fresh copy of the project, these two files will be missing.

Is there a way to have an "initial" copy of e.g. App.config in my SourceSafe repository, but at the same time prevent Visual Studio from checking out the file when it is locally edited by a developer?

Background: Why am I using SourceSafe at all? It's not my decision, and I can do nothing about it in the short term.

stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268

1 Answers1

1

You can use the pin feature to keep a copy but not allow checkout.

In solution explorer, locate your file (e.g. App.config), right click on it to call menu "Show History...", select a version of your file and then click button "Pin".

Rachel
  • 1,372
  • 1
  • 8
  • 11
  • Unfortunately, pinning a file in SourceSafe renders it uneditable in Visual Studio; which is contrary to what I am looking for. Thanks for the idea, nevertheless. – stakx - no longer contributing Jul 25 '14 at 09:06
  • 1
    You may manually remove the "Read-only" file property of your file to make the pinned file editable in VS, if you'd like to. – Rachel Aug 05 '14 at 08:31