views:

31

answers:

1

Note: I suspect my problem is related to this one: Visual Studio 2010 Publish Web feature not including all DLLs.

My app has some references that are wrappers for non-.NET libraries. These wrappers need the original DLL to be in the same directory as them and the executable.

The problem comes when publishing. Following the advice I found scattered around SO, I included these DLLs as resources, set "Copy to outcome directory" to "Copy always" and played around with "Build Action".

So far the closest I've come is to set "Build Action" to "Content". As in, this seems to be the only way to actually copy files when publishing, without embedding them or compiling them. The problem is, the files are automatically moved to a folder called "Resources".

Does anyone know how to do this?

+2  A: 

Is it possible that in your project you actually store the dlls in a folder called Resources? When files are copied to the output directory I think they're copied in the same directory structure they are in right then.

So you need to put the DLLs in your "root" project directory I think.

ho1
I'm an idiot. Thanks for this! (It's a shame it looks so messy though...)
Tom Wright
@Tom: Don't worry, the reason I found it out was because I did the same thing as you, and when I figured out why I also thought it looked ugly (if you get really annoyed by it you can add custom build tasks to copy the files manually, but it's not as stable if you might move the directory etc).
ho1