473,231 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Deployment folder question

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, 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 1965
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.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, 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\debug\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.CurrentDomain.SetupInformation.Applicati onBase
or
Application.StartupPath

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
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...
2
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...
4
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...
1
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...
3
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...
2
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
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...
3
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...
0
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.