473,566 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deployment folder question

Hi all,

I have an XML file that I reference in my windows application

I access it using - Application.Sta rtupPath & "/ini.xml"
During development this resides in the Bin folder, it appears this is
where the application is being run from when debug.

But when I build the project, install it (using a deployment project)
and then run it, I get a FileNotFound exception, because the XML file
is installed in the bin folder, but the application is now running from
the application folder (one level up from the Bin folder).

Whats the best way to set this up?

Thanks,
Mark

Jul 21 '05 #1
3 1984
In my opinion, I would put the ini.xml file in a fixed location on your
harddrive and add a configuration setting in your App.config file that points
to that fixed location - this way you avoid hard-coding the ini file location
in your code.

"Cuperman" wrote:
Hi all,

I have an XML file that I reference in my windows application

I access it using - Application.Sta rtupPath & "/ini.xml"
During development this resides in the Bin folder, it appears this is
where the application is being run from when debug.

But when I build the project, install it (using a deployment project)
and then run it, I get a FileNotFound exception, because the XML file
is installed in the bin folder, but the application is now running from
the application folder (one level up from the Bin folder).

Whats the best way to set this up?

Thanks,
Mark

Jul 21 '05 #2
Many thanks for you reply Jorge.

This seems like a bit of a 'work around'. I am new to 'win forms'
development and am sure there is a simple way to control the location
of files during deployment. For control however I do want the user to
be able to select a location when they install and then keep all the
installed files together. This way I wouldnt be hard coding the
location of the file, it would be in a sub folder of the application.

The specific problem is that during development the application seems
to reside in teh bin folder, but the exe is deployed one folder higher.

An alternative, would be to force my development environment to build
the exe and debug from that in the correct location perhaps?

Also, all of the DLL's that are bing distributed with my app (Crystal
etc) are being deployed in the root folder of the application and not
the bin folder. Is this part of the same issue?

Thanks again, Mark

Jul 21 '05 #3
When you build a windows forms project the EXE is always placed in either the
bin\debug or bin\release folder of your project directory. If your windows
project is on drive c: and is called "MyApp" then the path to your EXE for a
debug configuration would be:

c:\myapp\bin\de bug\myapp.exe

if you XML file is in c:\myapp then your code will have to account for the
fact that during development your EXE is in the bin\debug folder. You can try
using:

AppDomain.Curre ntDomain.SetupI nformation.Appl icationBase
or
Application.Sta rtupPath

to determine the path to your XML file.

"Cuperman" wrote:
Many thanks for you reply Jorge.

This seems like a bit of a 'work around'. I am new to 'win forms'
development and am sure there is a simple way to control the location
of files during deployment. For control however I do want the user to
be able to select a location when they install and then keep all the
installed files together. This way I wouldnt be hard coding the
location of the file, it would be in a sub folder of the application.

The specific problem is that during development the application seems
to reside in teh bin folder, but the exe is deployed one folder higher.

An alternative, would be to force my development environment to build
the exe and debug from that in the correct location perhaps?

Also, all of the DLL's that are bing distributed with my app (Crystal
etc) are being deployed in the root folder of the application and not
the bin folder. Is this part of the same issue?

Thanks again, Mark

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2018
by: Paul | last post by:
Hello everyone: I am developing a VB.Net Windows Application and I am now ready to create the deployment project for it. This application needs to be installable on a different number of users / clients, and the application has an Access DB out on their network. How can I create a deployment routine where I can have a dialog box prompt...
2
2743
by: C# WannaBe | last post by:
Hi, I created a C# deployment wizard to deploy my project. The project gets deployed correctly, all the files get copied to the correct folder etc. The only problem is that it does not create any desktop icons, or entries in the Start->Programs menu. There is no way to start the program that has been deployed! What am I doing wrong here?...
4
3509
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
1
650
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the...
3
281
by: Cuperman | last post by:
Hi all, I have an XML file that I reference in my windows application I access it using - Application.StartupPath & "/ini.xml" During development this resides in the Bin folder, it appears this is where the application is being run from when debug. But when I build the project, install it (using a deployment project) and then run it,...
2
13833
by: Bill Nguyen | last post by:
I ran into this error trying to run an app from Publish.htm. I can't find what is wrong with the deployment. Thanks a million Bill -------- PLATFORM VERSION INFO
1
1879
by: Pete Wittig | last post by:
Hi, I am trying to create a Setup and Deployment project for a Serviced Component. In my solution I have two projects. The first is the class library that contains my serviced component as well as an installer class. The second is the setup and deployment project. I have added the "Global Assembly Cache Folder" to the "File System on...
3
1263
by: Michael A. Covington | last post by:
Greetings, Here's a question about deploying my C# application. My program includes a large library of data files. As far as I can tell, data files can only be added to a deployment project one at a time. Is there a way to add a whole folder, with all its contents and subfolders, to a deployment project such that it will be installed...
0
1709
by: Sid Price | last post by:
HI, I am not sure this is the correct place to raise this question, please redirect me if not. I have a VB.NET application with a deployment project. I need to create a folder on the target machine that can be accessed by the application and also a service that is also installed and started by the installer. Both application and service need...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.