473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Automatically copying a file to compile directory?

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
4 1969
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
5
by: Ian Davies | last post by:
Hello I am trying to use php to automate the copying of a file from my remotely hosted directory to my computer. I have put together the following but it will only do the copying from one...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
17
by: Kerr | last post by:
Hi all, I am sure that this is quite simple but can't find any good examples anywhere. I need a method of copying multiple files from a source directory to a destination directory. The file...
2
by: .Net Believer | last post by:
I using the routine below to copy file to a network drive for a regular backup process. Before calling this routine I using another function to check the presence of the LAN connection and the...
3
by: Phil Galey | last post by:
In VB.NET, is there any way to copy a directory and all its contents to a new location using io.Directory or io.DirectoryInfo etc. without having to import the Scripting.FileSystemObject? ...
3
by: kiwi | last post by:
Hello: I have a DLL that must update into a server. I want to make automatic proccess that copy that dll from a directory(Ex: c:\update) to application directory (ex: c:\application). Copy file...
2
by: Alan Bak | last post by:
HI I am running Active Perl on a Windows XP machine. I am hoping to get some advise on a strategy to monitor and copy files that are arriving in a directory and need to be copied to a second...
7
by: gtb | last post by:
I wish to copy the highest version number of a file from directory \ \ \fileserver\D:\scripts to C:\scripts where the file names are of the form filename_MM.NN.SS.zip, where MM, NN, and SS...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.