views:

25

answers:

1

I'm using VS2008 w/ TFS. I have a commercial package that is a .NET dll and two other dll files that .NET dll uses. I want these files to be separate from the projects that use them.

I can easily make a reference in my C# project to the .NET dll and indicate "copy" so that it gets copied to the output (bin) directory to be used from there at run-time. But, this does not bring over the other two dll files the .NET dll file requires. I cannot make the same kind of reference to these other two dll files because they are not assemblies, COM objects, etc.

I can add a post-build command that would copy them, but while I can use $(TargetDir) for the destination, I don't know something to use for the source. I could use my machine's setup, but that will failure everywhere else.

I hope VS has some built-in mechanism for cases like this...

+1  A: 

The easiest way is to add the "other" files as content files to the project.

Add the files to the project

Select the file and press F4 for the properties window

Set property Build Action to Content

Set property Copy to Output Directory to Copy always

An other option is to do this with a build script.

Hakan Forss