Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

visual studio 2008 - Copy to Output Directory copies folder structure but only want to copy files

I have a VS2008 I want to copy certain files from a directory into my /bin/ folder. I have set the files (located in /common/browserhawk/) to "Copy to Output Directory". However, it copies the folder structure as well: the files are copied to /bin/common/browserhawk/

How do I get these files to copy to just /bin/? I do not want to store these in the root of the website to get them to copy correctly.

Related Question: Visual Studio adds .dll and .pdb to project after compiling

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can add a Post Build Event to copy the files.
Go to project properties, Build Events tab and add the following to the Post-build event command line:

copy "$(ProjectDir)commonrowserhawk*.*" "$(TargetDir)"

Be sure to include the quotes if your project path has spaces in it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...