[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help with adding folder in project

Posted on 2012-03-21
5
Medium Priority
?
191 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
[X]
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
  • 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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