Question

Microsoft provides the source code of vshadow to manipulate VSS (Volume Shadow Service [shadow copy]), and I've modified it a bit but I want to make it into a dll so I can use it in my C# projects. I don't know exactly how to go about doing that, the source code is fairly simple, and it shouldn't be too hard, but I don't really know where to get started. How should I go about converting it to a usable dll instead of compiling to a executable?

Update: Someone has already done this: http://www.alphaleonis.com/2008/08/alphavss-bringing-windows-shadow-copy-service-vss-to-net/

Was it helpful?

Solution

You will need to change your project settings in Visual Studio to create a DLL. In addition you will need to define dll entry points.

However, the VSS is a set of COM API's, so you can call them directly from C# with pinvoke, instead of using this wrapper C++ executable.

Since the SDK only contains libs, not DLL's you'll have to create a dll project to use it.

This is a good blog-how-to.

You'll need to download the VSS SDK (if you haven't already).

Decent article on pinvoke.

Hope this helps.

OTHER TIPS

Such a task can range from trivial to extremely complex. In your case, the issue probably leans towards the complex end.

The reason for this is because you need to replace the existing interface with a new set of functions that you can use. These functions will then need to be exported, so you can import them in dotNet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top