Dynamically add files to visual studio deployment project.

Posted by Graeme Yeo on Stack Overflow See other posts from Stack Overflow or by Graeme Yeo
Published on 2009-07-21T15:50:00Z Indexed on 2010/04/04 8:03 UTC
Read the original article Hit count: 414

I've been desperately looking for the answer to this and I feel I'm missing something obvious.

I need to copy a folder full of data files into the TARGETDIR of my deployment project at compile time. I can see how I would add individual files (ie. right click in File System and go to Add->File) but I have a folder full of data files which constantly get added to. I'd prefer not to have to add the new files each time I compile.

I have tried using a PreBuildEvent to copy the files:

copy $(ProjectDir)..\Data*.* $(TargetDir)Data\

which fails with error code 1 when I build. I can't help but feel I'm missing the point here though. Any suggestions?

Thanks in advance.

Graeme

© Stack Overflow or respective owner

Related posts about deployment-project

Related posts about copy