Howto copy content files to build directory

  • Thread starter Thread starter dansan
  • Start date Start date
D

dansan

Either Microsoft is a fluke or there is a very simle way of doing
this.

In MSDN MS rants about how important testing and debuing is, and how
their tools allow you to do this oh, but so easily... jet I still have
too find a way to have my content files moved to my build directory
(either Debug or Release, whichever I happen to be working on). This
is ridiculous. I have to go outside the program and actually copy the
files that I have already told the IDE are 'content'. No amount of
searching on the net has produced a good result... The only answer
that people give is... well, build yourself a deployment... Yes, I
know, I can include content files in a deployment project... but you
don't install your deployment project everytime you want to run a test
of your program on your development machine, that is simply ludicrous.

I hope someone out there knows the answer to this question. I have
spend way more time than this issue should take trying to figure out
'the right way of doing it' to no avail.

Thanks all,

Daniel.
 
dansan said:
Either Microsoft is a fluke or there is a very simle way of doing
this.

In MSDN MS rants about how important testing and debuing is, and how
their tools allow you to do this oh, but so easily... jet I still have
too find a way to have my content files moved to my build directory
(either Debug or Release, whichever I happen to be working on). This
is ridiculous. I have to go outside the program and actually copy the
files that I have already told the IDE are 'content'. No amount of
searching on the net has produced a good result... The only answer
that people give is... well, build yourself a deployment... Yes, I
know, I can include content files in a deployment project... but you
don't install your deployment project everytime you want to run a test
of your program on your development machine, that is simply ludicrous.

I hope someone out there knows the answer to this question. I have
spend way more time than this issue should take trying to figure out
'the right way of doing it' to no avail.

Disappointingly, only C++ projects permit custom build steps - I have used
these in the past for file copy and other things.
Maybe you could create a Makefile project which takes care of file copying
and add it to the workspace so that it is built along with your main
project. Seems like hard work, I'm still only starting out with .NET but I
have a feeling I'm going to need something similar before long.

Ian
 
Ian Harding said:
Disappointingly, only C++ projects permit custom build steps - I have used
these in the past for file copy and other things.
Maybe you could create a Makefile project which takes care of file copying
and add it to the workspace so that it is built along with your main
project. Seems like hard work, I'm still only starting out with .NET but I
have a feeling I'm going to need something similar before long.

Ian

If you are using VS.NET 2003, you can set up a pre-build or post-build event
to copy the files. Look in the porject properties under "Common
Properties -> Build Events".

Adrian
 
Maybe I'm missing everything here, but at least in VB.NET when you add
content to the solution explorer there is an option to 'Copy Local' in the
file's property page. Setting it to true will copy it to the bin or
whatever directory.
 
Stephen said:
Maybe I'm missing everything here, but at least in VB.NET when you add
content to the solution explorer there is an option to 'Copy Local' in the
file's property page. Setting it to true will copy it to the bin or
whatever directory.

Hmmm... The only options that I get for my files in their property
window are:

- Build Action
- Custom Tool
- Custom Tool Namespace
- File Name
- Full Path [greyed out]

I can't find any 'Copy Local' option. Where exactly is this property
found? (I was looking at an xml file that I have under one of my
projects).

Thanks.

Daniel.
 
Back
Top