Using "Relevant_Masks" to Add Files to VSS Selectively

A reader who must have seen my previous post about how to deploy files selectively using wildcards writes, “I am adding some legacy asp applications into VSS ... some [are] flash files (*.fla, *.swf) and I would like to exclude them from the solution add process. I added "Relevant_Masks = !*.swf, !*.fla" to my SS.ini, but the files are still getting added. I have several more virtual directories to add, do you have any suggestions?”

As I outlined in VSS Options, a Brief Architectural Overview, almost all VSS options are stored in a pair of initialization files:

  • srcsafe.ini contains database-wide options and
  • ss.ini file contain user-specific settings

When Relevant_Masks appears in an ini file, a SourceSafe client CAN but does not necessarily have to consult it for further instructions when adding files to the VSS database with which it is associated.  As documented in the VSS help topic, Relevant_Masks Initialization Variable, this variable accepts two types of masks:

  • An include mask (e.g., Relevant_Masks = *.vbproj, *.vb, *.config, *.etc) explicitly includes files of the types listed and implicitly excludes all others. 
  • An exclude mask (e.g., !*.ico), explicitly excludes files of the type listed but implicitly includes all others., one that explicity includes (*.vbproj) and exclude (!*.ico).

I spent two fruitless hours yesterday fiddling with Visual SourceSafe and Visual Studio .NET 2003 trying to get them to pay attention to the Relevant_Masks initialization variable.  Finally, I just opened a command shell and punched in “SS ADD C:\temp\*.* -R -Ykorby” (c:\temp contains the files of a C# Windows application project that I created in Visual Studio .NET 2003, one of which is app.ico).  Eureka!  That did the trick.

In a fit of frustration, I finally emailed one of my developers for an explanation. I don’t bug them until I’ve exhausted all other resources. He explained that the SourceSafe plug-in for Visual Studio is a MicroSoft Source Code Control Interface (MSSCCI) client. MSSCCI doesn’t honor the VSS Relevant_Masks initialization variable. Thus, there’s no way to preemptively exclude files of certain types from being added to VSS from Visual Studio .NET. The workaround is to use the Exclude from Source Control command after creating a solution or project.