0

Consider This:

I have folder called \SQLCE35Dlls inside my solution. It has some dlls that are required for application to interact with a SQLCE database in a stand alone fashion [without sql server ce 35 install on the PC].

After a build, I want these files to go to bin/debug and not to bin/debug/SQLCE35Dlls/. Setting "Copy if Newer" creates the latter situation. I want the former.

Is it possible to facilitate this or does this have to done as part of the installer script? [avoiding the solution of adding the dlls at the root level of the solution instead of inside a folder].

This is a Winforms project solution.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
CF_Maintainer
  • 973
  • 2
  • 12
  • 30
  • See also:" https://stackoverflow.com/questions/53449893/visual-studio-post-build-event-how-to-copy-files-to-output-bin-directory-on?noredirect=1" – Philm Nov 23 '18 at 23:31

1 Answers1

1

You can perform any custom file copying operations by adding a post-build event command. Look at the Build Events tab of the project properties page.

Create the command using the xcopy command and the appropriate built-in macros. Click the Edit Post-build button to see the macros.

example:

xcopy $(TargetDir)\SQLCE35Dlls $(TargetDir)

This should copy all the files from bin\debug\SQLCE35Dlls to bin\debug.

Igby Largeman
  • 16,495
  • 3
  • 60
  • 86
  • Thanks Charles, that did it. I ended up using the following to avoid 2 copies of the .dlls floating around. MOVE /Y $(TargetDir)\SQL35ReqDlls\*.dll $(TargetDir) – CF_Maintainer Apr 15 '10 at 13:01