How do I prevent Visual SourceSafe from writing the vssver2.scc file when getting a file with Microsoft.VisualStudio.SourceSafe.Interop?
I get a file from Visual SourceSafe using the below code:
IVSSItem vssFile = vssDataBase.get_VSSItem(vssFilePath + @"/" + fileName, false);
VSSItem itemVer = vssFile.get_Version(latestVersionNumber);
itemVer.Get(ref getFilePath, (int)VSSFlags.VSSFLAG_FORCEDIRNO | (int)VSSFlags.VSSFLAG_REPREPLACE | (int)VSSFlags.VSSFLAG_USERRONO);
Visual SourceSafe adds a vssver2.scc file to each folder. Is there a way to prevent this from happening?
I've tried various combin开发者_开发问答ations of the VSSFlags enum with no luck. I don't need to preserve any history and the file will never be checked back in. I just want a clean checkout.
Obligatory disclaimer: I can't switch to another source control program.
I realized my interest in getting files cleanly via SourceSafe.Interop was more aesthetic than practical. I'm still interested in a solution but I ended up doing this after all the files were checked out.
foreach (FileInfo visualSourceSafeFile in testDirectoryInfo.GetFiles("*.scc", SearchOption.AllDirectories))
{
visualSourceSafeFile.Attributes = FileAttributes.Normal;
visualSourceSafeFile.Delete();
}
If you don't change the file attribute to Normal before you delete, you'll probably run into exceptions. Visual SourceSafe marks them as Hidden, System, and ReadOnly.
精彩评论