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?
WinterMuteUKConnect With a Mentor Commented:
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."
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.
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.

All Courses

From novice to tech pro — start learning today.