IVSS State Management Conundrum
I recently received
this C# code snippet from a customer (my question follows):
//remove all instances of label "bad label" in the versions collection objVSSVersion
foreach(IVSSVersion
objVssVersion in myVssItem.get_Versions(0))
{
if (objVssVersion.Label == "Bad Label")
objVssVersion.VSSItem.Label("","");
}
Upon running
this code, the customer sees one of two errors:
· "A
history operation is already in progress"
· "File
VSSSERVERPATH\data\s\sfvaaaaa is already open"
Conundrum
There
appears to be another VSSVersions object instantiated. At present, you can have
only one at a time.
To work
around this limitation, we have to figure out how to finalize the existing object,
right? I have some idea about how to do this but would like to hear your thoughts.
How does one do this? Is it even possible in C#?
Have you
run into this problem with an IVSS... object before? If so, what was your workaround.
Related
Posts and Resources
-
Reference
counting, garbage collection, and zombies, oh my!
-
https://blogs.gotdotnet.com/korbyp/PermaLink.aspx/e2d23ad6-24ef-478b-95b0-dd866bdbd5c4
-
https://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/vssauto.asp (VB)
-
https://www.codeproject.com/useritems/vssxml.asp
++++++++++++++++++++++
Microsoft
kann für die Richtigkeit und Vollständigkeit der Inhalte in dieser Newsgroup keine
Haftung übernehmen. Este mensaje se proporciona "como
está" sin garantías de ninguna clase, y no otorga ningún derecho. Ce message est fourni
en l état, sans garantie d aucune sorte, et ne vous confère aucun droit. Vous assumez
tous les risques liés à son utilisation.