Releasing software with project files included. Not happening

I have a C# application that I'm writing that has a Directory, including some XML documents, that doesn't get published to the release folder.

When I compile the project in release mode,the directory does not get coppied over. Is there something I'm not setting?

The project is 3 tiered, and my main (presentation) has the directory included in the project.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do the xml files get published to the debug folder when you build it in debug mode?
icompassAuthor Commented:
No they don't. I have to copy it there manually.

I only have the one exe, and 3 dll's when i build it.

Is there a way of setting it up so I get :

RootFolder/Bin/All Dll's
RootFolder/Data/XML Files

That would be ideal, but it's a small project so building an install is pointless. I mainly develope in ASP.NET and hardly touch the client side, but we need this small app to run on our servers to Support the ASP site.
I don't know how you could set up the project to build in that way, the way I would do it is use the post-build-event to run a batch/cmd file to copy the files after the build.

The following code will create the directories in the location you specify (%1 in the code) and copy the files to that location, it will first delete *everything* in the directories first though, to avoid overwriting...

Hope it helps, sorry I don't know any other way around this...

-----------Code Follows---------------

@echo off
::Usage, PostBuild.cmd <RootFolder>

::This is true if you enter no command line argument.
if "%1" == "" goto NoArgs

@echo -------- Creating Directories (And clearing existing.)
::Assuming that the command line argument %1 is the 'RootFolder'
::!!!The /Q setting for delete means that it won't ask you if you want to delete the files!!!
title Setting up MyProgram in %1
md %1
cd %1
del /Q *.*
md bin
md data
cd bin
del /Q *.*
cd data
del /Q *.*

::Like this so you can extend it to as many files as you want.
@echo -------- Beginning to copy exe files to %1
for %%i in (
) do @copy %%i %1

@echo -------- Beginning to copy dll files to %1/Bin.
for %%i in (
) do @copy %%i %1/Bin

@echo -------- Beginning to copy xml files to %1/Data.
for %%i in (
) do @copy %%i %1/Data


@echo You need to supply a command line argument to use this file:
@echo PostBuild.bat rootfolder
@echo "Where 'rootfolder' is the folder you want to copy to."

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.