Sourcesafe Automation Bug

As part of my continuing project in Sourcesafe Automation, I found a weird behavior of the Visual Studio Sourcesafe Interop DLL.

The following code is in Visual Basic 5 which basically connects to a Sourcesafe database and lists all the projects in the root folder of the database.


Dim vssdb As New VSSDatabase
 
vssdb.Open "<location to sourcesafe srcsafe.ini>", "<username>", "<password>"
 
Dim xitem As VSSItem
For Each xitem In vssdb.VSSItem(0).Items(False)
   Debug.Print (xitem.Name)
Next

Subsequently, the code equivalent in C# (.NET) , is something that I have blogged before. What I find unusual about the Sourcesafe Interop DLL are the following items:

  1. The “Open” method doesn’t work for the C# version for Sourcesafe .ini files located on a remote location (e.g. \\servername\folder\srcsafe.ini) while the one in the pre .NET environment works well. However, when the location is in the same physical directory as where my website runs, the C# version works well (e.g. vssDb.Open(@”c:\some-directory\srcsafe.ini”, “username”, “password”). A tried a tweak by making the remote location as a mapped network folder but the error is still the same.
  2. In the .NET version, if you placed a bogus file that does not exist in a directory that has a srcsafe.ini (e.g. In vssDb.Open(@”c:\some-directory\srcsafe.ini”, “username”, “password”), you intentionally change “srcsafe.ini” to “srcsafe2.ini”), the system will read the srcsafe.ini in that folder. However, if you specify only the folder or when you remove/rename the “srcsafe.ini” and explicitly change the name in the “Open” method, still that won’t work.

Various searches in Google and other search engines doesn’t work. The closest related result is found here but still the discussion was open-ended. Any suggestions?

Advertisements

0 Responses to “Sourcesafe Automation Bug”



  1. Leave a Comment

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




Blog Stats

  • 3,965 hits
April 2008
S M T W T F S
« Mar   May »
 12345
6789101112
13141516171819
20212223242526
27282930  

%d bloggers like this: