By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,488 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

Automatically copying a file to compile directory?

P: n/a
Really more of a VS.NET question than a C# question.... I have a couple
files in my solution that I would like copied to the compile directory when
the solution is built. How do I set it up so that everytime I build the
solution these files will automatically be copied into the same directory?
Thanks,
Jacob
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In the post build event add a batch command. You can set the post build
event from project properties->Common properties->Build Events.

--

This posting is provided "AS IS" with no warranties, and confers no rights.
"Jacob" <js@hotmail.com> wrote in message
news:pZZxc.26676$1c4.3528@fed1read06...
Really more of a VS.NET question than a C# question.... I have a couple
files in my solution that I would like copied to the compile directory
when
the solution is built. How do I set it up so that everytime I build the
solution these files will automatically be copied into the same directory?
Thanks,
Jacob

Nov 16 '05 #2

P: n/a
Bob
Use the menu Project - Properties

Click on Build Events

In Post-build Event Command Line put your copy statements, such as:
copy "$(ProjectDir)XML Files\config.xml" "$(TargetDir)"

Set the Run the Post-build Event? to suit your needs.

In my example the $(ProjectDir) will start the path of the file to
copy at the project root, and the $(TargetDir) will put in the same
directory as the build which will change automatically when you do a
Debug or Release build.

If you click on Help on the Project Properties Pages dialog, it will
bring up a list of available macros you can use in addition to these
2.

Bob

"Jacob" <js@hotmail.com> wrote in message news:<pZZxc.26676$1c4.3528@fed1read06>...
Really more of a VS.NET question than a C# question.... I have a couple
files in my solution that I would like copied to the compile directory when
the solution is built. How do I set it up so that everytime I build the
solution these files will automatically be copied into the same directory?
Thanks,
Jacob

Nov 16 '05 #3

P: n/a
Thanks, I knew it was something simple.

Jacob
"S. Han" <@> wrote in message news:40********@news.microsoft.com...
In the post build event add a batch command. You can set the post build
event from project properties->Common properties->Build Events.

--

This posting is provided "AS IS" with no warranties, and confers no rights.

"Jacob" <js@hotmail.com> wrote in message
news:pZZxc.26676$1c4.3528@fed1read06...
Really more of a VS.NET question than a C# question.... I have a couple
files in my solution that I would like copied to the compile directory
when
the solution is built. How do I set it up so that everytime I build the
solution these files will automatically be copied into the same directory?

Thanks,
Jacob


Nov 16 '05 #4

P: n/a
Thank you so much. I just couldn't find that info anywhere.

Jacob
"Bob" <bl*******@hotmail.com> wrote in message
news:27*************************@posting.google.co m...
Use the menu Project - Properties

Click on Build Events

In Post-build Event Command Line put your copy statements, such as:
copy "$(ProjectDir)XML Files\config.xml" "$(TargetDir)"

Set the Run the Post-build Event? to suit your needs.

In my example the $(ProjectDir) will start the path of the file to
copy at the project root, and the $(TargetDir) will put in the same
directory as the build which will change automatically when you do a
Debug or Release build.

If you click on Help on the Project Properties Pages dialog, it will
bring up a list of available macros you can use in addition to these
2.

Bob

"Jacob" <js@hotmail.com> wrote in message

news:<pZZxc.26676$1c4.3528@fed1read06>...
Really more of a VS.NET question than a C# question.... I have a couple
files in my solution that I would like copied to the compile directory when the solution is built. How do I set it up so that everytime I build the
solution these files will automatically be copied into the same directory?

Thanks,
Jacob

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.