Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Releasing software with project files included. Not happening

Posted on 2004-10-29
Medium Priority
Last Modified: 2013-11-18
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.
Question by:icompass
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 12461325
Do the xml files get published to the debug folder when you build it in debug mode?

Author Comment

ID: 12474032
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.

Accepted Solution

WinterMuteUK earned 500 total points
ID: 12474398
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."

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question