views:

26

answers:

3

I'm using VS2010. I've got a C# project that uses a few native DLLs. In my source tree, I have these native files stored in a "DLLs" directory underneath the main solution directory. In my C# project, I have the "DLLs" folder listed with each of the DLLs inside it. Each DLL is set to build action "Content" and "Copy to Output" set to "Always".

Unfortunately, because these files are in a subdirectory, VS seems to think they should be deployed that way. Instead of being deployed to \bin\Debug, they're being deployed to \bin\Debug\DLLs. Is there any straightforward way to convince VS to deploy them directly to \bin\Debug, or will I have to do some kind of custom build action to copy them into place?

A: 

We are using Build Events for such a thing. Simply write xcopy command and copy all dlls into desired folder

Sergey Mirvoda
A: 

I think you need the build action. You don't have to create a whole build script, though -- under the "Build Events" tab of the project properties you can specify what to do in the "Post-build event command line."

Jay
A: 

This is because you've got them in a Folder in the solution. The pragmatic solution is to simply add them to the solution root, the actual location of the file doesn't matter. That perhaps creates a wee bit of clutter in your Solution Explorer window. If that's unacceptable then a pre-build event that uses xcopy /d is the workaround.

xcopy /d "$(ProjectDir)DLLs\*.dll" "$(TargetDir)"

Hans Passant
Yeah, that's what I figured. Thanks.
markerikson