VSS and CruiseControl.NET

Recently, a respected member of the .NET community asked for some “gotchas” when using SourceSafe with CruiseControl.NET. At first, I was thinking, “There really aren’t any. It is working fine for us” however when thinking back on the setup of the current infrastructure I recall there was some tweaking necessary to get things rolling.

DISCLAIMER: I would like to preface any content of this article by saying that I am by no means a VSS fan. It is free, it is just good enough, and it is already in place. I already know what tool I want to switch to when the time is right, but for today I work in a VSS shop.

So, if you are going to setup CCNet with SourceSafe, here are some things to keep in mind. With respect to things to stay away from, I experienced some issues when I tried to monitor a large number of projects. You also may experience VSS timeouts if the project folder you point to has too many subfolders/files. In some cases, the VSS history command to see if anything had changed since the last build took longer than the preset timeout (I believe it is 30 seconds)!!! So it would help to be selective in the points you monitor within VSS. If you keep your solutions/projects to smaller, more manageable sets of code you’ll probably be more successful.

One thing you could try is to time the history commands from a command line. When using VSS, CCNet essentially issues a command like the following:

SS.EXE history $/Devl/Products/XYZ/Common/2.0/Batch -R -Vd12/5/2007;5:01a~12/4/2007;1:11p -YBuildUser, -I-Y

By executing this manually you can get a feel for how long it will take to execute the command. The CCNet logs will show if you experienced a timeout:

2007-12-05 05:04:20,165 [Accounting Batch 2.0:WARN] Process timed out: C:\Program Files\Microsoft Visual SourceSafe\SS.EXE history $/Devl/Products/XYZ/Common/2.0/Batch -R -Vd12/5/2007;5:01a~12/4/2007;1:11p -YBuildUser, -I-Y.  Process id: 3928.  This process will now be killed.
2007-12-05 05:04:22,994 [Accounting Batch 2.0:WARN] The process has been killed: 3928
2007-12-05 05:04:23,040 [Accounting Batch 2.0:ERROR] Exception: Source control operation has timed out.

Despite some pain getting the right level of monitoring, it is now a useful tool. I would definitely encourage use of the CCTray app for all developers. This seems to be the easiest way to communicate a breakage. You can also use the web dashboard to show the history of what has happened:
CCNet Web Dashboard


7 Responses

  1. i’m glad to find a paper dissussing the vss timeouts because i’ve met with.Recently my scripts often timeouts , it doesnot complie for the source code hasnot been got, i have to get the source manually,

    i set timeout option to 3600, however the problem contines to occur, Do u have any solution?

    i’m appreciated if you can share~ thank u~

  2. One possible option would be to “get” from a lower spot in your folder tree. Sometimes VSS can perform better if you aren’t having to do a history on as many files.

  3. It’s amazing

  4. Finally I found something talking about the real problem. I am dealing with a huge project with many subs. Is there any way I can get rid of the “time out”? I tried to give 18000, still got caught. Please help!
    Thanks allot!

  5. One approach could be to look at creating sub solutions. Most likely not every project will have dependencies on every other project. However, it is logical to keep all related projects in a single solution for ease of developer use. If you can split things up and build them separately (using a different folder as the CCNet monitoring point) you might have better luck.

    Tried TeamCity?

  6. One way to avoid the excruciating time source safe takes to retrieve files is to set the configuration item alwaysGetLatest to true. When this is set Cruise control does not use the -V command line option when calling source safe; the files are then returned at a reasonable speed.

  7. Thank you for this article. I am new to CruiseControl. I am getting this error:

    source control operation failed: $/my-project-name is not an existing file or project

    I will appreciate your any help from you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: