Solved

Help with adding folder in project

Posted on 2012-03-21
5
171 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

20 Experts available now in Live!

Get 1:1 Help Now