?
Solved

Help with adding folder in project

Posted on 2012-03-21
5
Medium Priority
?
190 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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 …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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