Solved

Help with adding folder in project

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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