Solved

Help with adding folder in project

Posted on 2012-03-21
5
173 Views
Last Modified: 2012-06-27
Hello,

I'm trying to create a separate folder to put my xml files, I created an XMLFiles folder in my application but when I run the Setup project, it doesn't include it my project, therefore when I install and run the project, the program can't find the xml files, below is the code I used to find my XML files in the XMLFiles folder. How do I include XMLFiles folder as part of my Setup project?

Application.StartupPath + "\XMLFiles\Receiver.xml"

Thanks,

Victor
0
Comment
Question by:vcharles
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37750460
Right click the setup project in visual studio and select Add then Project Output, you will then be able to add the folder from your application project.
0
 

Author Comment

by:vcharles
ID: 37752728
Hi,

In Project Output, I see sevaral option, includinf Content Filkes, Sources Files, but no possibility to add the XMLFiles folder.

Victor
0
 
LVL 16

Accepted Solution

by:
Rose Babu earned 500 total points
ID: 37756009
Hi,

you may try any one of the below methods.

Method 1:

You are creating a setup project to be install an application in other(own) system(s). so, you can create the folder in your setup project itself.
open the setup project
click 'File System Editor' icon in the Solution explorer
Expand the 'Application Folder' in the left side tree view
Right click 'Application Folder' menu - > Add - > Folder (name it as your wish like XMLFiles)
Build your solution
then test the application by installing.
Method 2:

Create the folder from your application itself.

once your application starts or wherever you need to access the XMLFiles folder, check that folder exists or not.
if not exists then create it and do further process.
Dim dir As String = Application.StartupPath + "\XMLFiles\"

If Directory.Exists(dir) = False Then
	Directory.CreateDirectory(dir)
End If

' Do your process

Open in new window

Hope this may clear you.
0
 

Author Comment

by:vcharles
ID: 37759176
Thanks, regarding the second approach, once I create the foder, how do I copy a my XM fies from my application folder to my XMLFiles foder? Or is possibe to create the foder and copy the fies to it  during the Setup?
0
 
LVL 16

Expert Comment

by:Rose Babu
ID: 37759983
while creating setup project, you can add those XML files by right clicking the "XMLFiles" folder in 'File System Editor' and Add -> File then select the xml files.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now