Getting Started

Jan 14, 2009 at 8:26 PM
Finally, an implementation for .Net to use VSS.  Do you have documentation or even a quick readme file that explains how to include the DLLs in a project?  I know a sample application is mentioned in the Issue Tracker, but I'll take anything at the moment, lol.
Jan 15, 2009 at 7:29 PM
No, unfortunately I have not yet had the time to write any documentation. However, not much documentation in addition to the MSDN documentation on the VSS API should be required. There is a full API-documentation, and I would suggest starting by looking at IVssImplementation which provides an interface for accessing the global functions from the VSS API, most importantly the CreateVssBackupComponents which will return the instance of IVssBackupComponents used for most tasks.  An instance of IVssImplementation can be obtained using the LoadImplementation() method from the VssUtils class. This will load the correct implementation depending on the platform on which the assembly is executing.  This however requires that the assemblies can be found since they are looked up by assembly name, meaning they must either be in the directory of the executable, or placed in the GAC.

The only assembly that should be statically referenced from your Visual Studio project (by doing "Add Reference...") would be AlphaVSS.Common.dll, containing all the interfaces, enumerations and some of the classes (VssUtils for one).

The rest is really fairly well documented on MSDN (how the VSS API works) and in the API documentation for AlphaVSS.  So hopefully this will be enough to get you started.  I'm still planning on doing more, but unfortunately work is taking up a lot of time now, but hopefully I will get there eventually.

If anyone feel like helping out in any way with the development of AlphaVSS, please drop me a line!

Good luck, and don't hesitate to write again if you have any other more specific questions.

Sincerely, Peter
Feb 2, 2009 at 9:13 AM
Edited Feb 2, 2009 at 9:13 AM
Hi all,

I have put together what I have learned with using VSS and AlphaVSS into a little sample app of how to backup a file that is in use.

Download the file here

cheers all
Oct 17, 2010 at 9:39 AM

Thank you so much for you demo project.

Made my day.

Dec 3, 2010 at 4:18 PM


Thank you, thank you, thank you!  I've been beating my head against my desk all morning trying to figure this out!  This is my first project using VSS and it's not exactly a simple concept.  Your example ran perfectly and I'm going through your comments now so I'll understand what's happening.


I registered on the forums just to say thanks!  You are my hero.  Well, you and the fine folks behind AlphaVSS.  I'm so glad I kept looking.  API calls don't scare me, but those API calls sure did.  lol.

Thanks again,

Ray - The worlds best study software!

May 3, 2012 at 6:23 PM

Hey lojikl,


Would you mind updating your code to reflect the new changes in the latest release for .Net 4.0?


Any help would be wonderful,


Mar 8, 2013 at 2:25 AM
Can anyone provide any detail on how this demo code may be adapted to copy entire folders rather than files?
Mar 21, 2013 at 10:32 PM
                oVSSImpl = VssUtils.LoadImplementation();
                oVSS = oVSSImpl.CreateVssBackupComponents();
                oVSS.SetBackupState(false, true, VssBackupType.Full, false);
                Guid gSnapshotSet = oVSS.StartSnapshotSet();
                String sVolume = "C:\\";
                Guid gSnapshot = oVSS.AddToSnapshotSet(sVolume, Guid.Empty);
                oProps = oVSS.GetSnapshotProperties(gSnapshot);
May 15, 2013 at 2:59 AM
hey vikela,

when i attempt to run the project i have downloaded for fungusware/alphavssdemo, it throws an exception "Attempted to perform an unauthorized operation."

i dont have any idea to resolve this issue..

i have to use vss in my project in whcih i have to do following task...

1). to make backup of fiels and folders on a scheduked timely basis

2). to backup also for lock files

so anyone please help me to solve this i can use it in my project ASAP.

May 15, 2013 at 3:32 PM

Hi abhishekagrwl25,

Have you tried running the VS solution as an administrator? (Right click on VS 2012 icon choose “run as administrator”).

With regards,
Peter Kraijenbrink

FixHet - Systeembeheer
Geestdorp 22-II
3444 BD Woerden
Tel: 0348-410220
Gsm: 06 - 27231926
[email removed]>

May 17, 2013 at 1:20 AM
Hi Peter,

First of all thanks for the solution, now its working...:)
but i can do the backup operation with it but i also need for restore for the backed-up data...

how to do it....i have also googled for it but didnt find any solution or demo application like fungusware's demo for backup...??

With Regards,
Abhishek Agrawal
May 18, 2013 at 11:21 AM

Hi abhishekagrwl25,

Glad to hear it’s working ok now..

Did you read about restoring under VSS?

I don’t know about any demo appl. However several classes and example appl, like AlphaShadow, do contain restore methods or references.

With regards,

Peter Kraijenbrink

FixHet - Systeembeheer

Geestdorp 22-II

3444 BD Woerden

Tel: 0348-410220

Gsm: 06 – 27231926


Mail: [email removed]

May 19, 2013 at 2:03 AM
Hey kraijenp,

I have read the above documentation but i have problem in CreateVssExamineWriterMetadata that how to getwriterdata while i dont have any functio named getwritermetadata...??
May 19, 2013 at 10:55 AM

Hi abhishekagrwl25,

WriterMetadata can be retrieved from the Alphaleonis.Win32.Vss.IVssBackupComponents.WriterMetadata property.

With regards,

Peter Kraijenbrink