none
problem alphavss wrapper RRS feed

  • Question

  • hi guys .

    i intend to get vss (volume shadow copy services) backup from a drive by "alphavss" wrapper in c# as my backup be displayed in previous version tab of it's drive (properties > previous version) .

    i write below code :

                IVssImplementation vssImplementation = VssUtils.LoadImplementation(); 
                using (IVssBackupComponents vssBackup = vssImplementation.CreateVssBackupComponents())  
                {
                    vssBackup.InitializeForBackup(null);
    
                    vssBackup.GatherWriterMetadata();
                    vssBackup.SetContext(VssSnapshotContext.Backup);
                    vssBackup.SetBackupState(false, false, VssBackupType.Full, false);  
                    Guid MyGuid_1 = vssBackup.StartSnapshotSet();
                    Guid MyGuid_2 = vssBackup.AddToSnapshotSet("F:\\"); 
                    vssBackup.PrepareForBackup(); 
                    vssBackup.DoSnapshotSet(); 
    
                }


    this code provide vss backup .

    but gotten backup don't appear in previous version tab .

    i changed attributes in "SetContext" method :

    vssBackup.SetContext(VssVolumeSnapshotAttributes.Persistent | VssVolumeSnapshotAttributes.ClientAccessible | VssVolumeSnapshotAttributes.NoAutoRelease | VssVolumeSnapshotAttributes.Differential | VssVolumeSnapshotAttributes.AutoRecover);
    
    vssBackup.SetBackupState(false, false, VssBackupType.Full, false);

    but i get this error :

    "Alphaleonis.Win32.Vss.VssUnsupportedContextException: 'The operation is not supported under the current context."

    how to i change this code to my backup be displayed in previous version tab of it's drive?

    thanks

    Monday, December 24, 2018 8:47 PM

All replies

  • Hi SajjadKhati,

    Thank you for posting here.

    Since your question is more related to alphavss, you could post a new thread in Issues of GitHub.

    https://github.com/alphaleonis/AlphaVSS/issues

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by SajjadKhati Wednesday, December 26, 2018 8:28 AM
    • Unmarked as answer by SajjadKhati Wednesday, December 26, 2018 8:28 AM
    Tuesday, December 25, 2018 5:40 AM
  • thank you for the answer.

    we will ignore from the "alphavss" wrapper for now .

    but if i will intend to working by vss api , how to change above attributes? or how to change above code?

    Tuesday, December 25, 2018 12:30 PM
  • Hi SajjadKhati,

    Thank you for feedback.

    Sorry for that. Our forum do not support VSS. You could ask your question in suitable forum.

    https://stackoverflow.com/questions/tagged/volume-shadow-service

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 26, 2018 7:26 AM