alphaleonis/AlphaVSS

The VSS object was in an incorrect state for the requested operation

jegannathanmaniganadan opened this issue · 1 comments

Hello,

I have been experimenting VSS backup for SQL storage on iSCSI disk. I am looking to leverage AlphaVSS library for that. Things are fine when I use the sample project provided here, but it did not work when I use the nuget package with my own .NET class library. In fact I am trying the same code provided in the sample project.

I am basically looking forward to write a library that can freeze the given volume(s) for few seconds, so that I can take backup of those volume. Technically, I just re-invented whats provided in https://github.com/alphaleonis/AlphaVSS-Samples/blob/develop/src/VssBackup/VssBackup.cs

With that, I am facing the following problem when I pass something to Setup('C:\')

# $b = [Demo.VssBackup]::new()
# $b.Setup('C:\local\demo.txt')
Exception calling "Setup" with "1" argument(s): "The VSS object was in an incorrect state for the requested operation."
At line:1 char:1
+ $b.Setup('C:\local\demo.txt')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VssBadStateException

Note that I added the assembly into my powershell session to do this. FWIW, it just works with the sample project as I mentioned earlier. Although I do not know how to confirm whether the sample project works too. It just did not fail, hence assumed.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.