views:

820

answers:

2

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/

+3  A: 

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.

Alan
What are the VSS dll's that I need to import to use VSS from C#?
Malfist
I see only lib's in the SDK
Malfist
Microsoft.VisualStudio.SourceSafe.Interop. Mine was here: c:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Microsoft.VisualStudio.SourceSafe.Interop.dll. I'm not sure what pinvoke has to do with anything? Use COM interop? (or am I missing something?)
Aardvark
Yeah, its not visual Source safe, it's Volume Shadow copy Services ;)
Alan
...and source safe has a "shadow folder" feature - I see the confusion. SORRY!!
Aardvark
A: 

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.

Ash
So Asking a programming related question on a programming related message board is off topic?
Malfist
-1. No useful information and a bad attitude. The question is perfectly valid and hardness is relative...
jheriko
The question is not how to create a DLL, rather it's how to *convert* a specific exe into a DLL. Anything short of code would be considered useless. I do believe I had valuable information when I mentioned the steps that one should take to do the job. The question is badly formatted.
Ash