473,396 Members | 1,871 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,396 software developers and data experts.

application location

Hi,

How do I find out the path of the project that I am developing. I want to
create an ini file in the same folder as my application but I don't know how
to access the ini file because I can't seem to get a handle on the path of
the project

Any help would be appreciated

Thanks

Dec 4 '06 #1
3 1499
Hi,

bbdobuddy wrote:
Hi,

How do I find out the path of the project that I am developing. I want to
create an ini file in the same folder as my application but I don't know how
to access the ini file because I can't seem to get a handle on the path of
the project

Any help would be appreciated

Thanks
You can get the path of the executing assembly with:

Assembly.GetExecutingAssembly().Location

Note however that in some cases, the assembly is cached, so the path is
not what you may expect (especially for ASP.NET applications).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 4 '06 #2
I can't get a handle onto the Location property for the Assembly class. I am
developing this for a mobile device if this helps anybody
"Laurent Bugnion" wrote:
Hi,

bbdobuddy wrote:
Hi,

How do I find out the path of the project that I am developing. I want to
create an ini file in the same folder as my application but I don't know how
to access the ini file because I can't seem to get a handle on the path of
the project

Any help would be appreciated

Thanks

You can get the path of the executing assembly with:

Assembly.GetExecutingAssembly().Location

Note however that in some cases, the assembly is cached, so the path is
not what you may expect (especially for ASP.NET applications).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 4 '06 #3
try the fully qualified name:

System.Reflection.Assembly.GetExecutingAssembly(). Location
--
Good luck!

Shailen Sukul
Architect
(BSc MCTS, MCSD.Net MCSD MCAD)
Ashlen Consulting Service P/L
(http://www.ashlen.net.au)
"bbdobuddy" wrote:
I can't get a handle onto the Location property for the Assembly class. I am
developing this for a mobile device if this helps anybody
"Laurent Bugnion" wrote:
Hi,

bbdobuddy wrote:
Hi,
>
How do I find out the path of the project that I am developing. I want to
create an ini file in the same folder as my application but I don't know how
to access the ini file because I can't seem to get a handle on the path of
the project
>
Any help would be appreciated
>
Thanks
You can get the path of the executing assembly with:

Assembly.GetExecutingAssembly().Location

Note however that in some cases, the assembly is cached, so the path is
not what you may expect (especially for ASP.NET applications).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 4 '06 #4

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

Similar topics

0
by: Tony | last post by:
Hi I'm trying to debug the sample application in ASP.NET (CommereVBSDK) but the .NET environment is not allowing me to debug. I get the following error Error while trying to run project. Unable...
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
6
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone...
2
by: mark | last post by:
Can't figure this one out. I appears to not be code related. After surfing my asp.net web app for a while 5 - 10 min. it fails to open any further connections to my access 2000 database. There...
5
by: Lars-Erik Aabech | last post by:
Hi! Guess it's my day again.. Tried to deploy a test release of a new asp.net web today, and got a terrible error. The web is running swell on three development computers, but when it's copied...
1
by: R Hedges | last post by:
Hi there-I'm an AMATEUR VB.NET programmer, who has hacked together a small VB.NET application that can get information from remote machines using the System.Management namespace. MY APPLICATION...
7
by: hgirma | last post by:
Hello Gurus, Is it possible to schedule a task to run an application deployed using ClickOnce? The executable changes location with each update.. and if i were to run the executable directly,...
3
by: pooba53 | last post by:
I have a VB .NET 2003 application that communicates with an Access db. I am deploying the application using the Wizard that creates an install package and it IS properly grabbing the Access db and...
2
by: Learning.Net | last post by:
hi , I have a application which reads files, directory,and its version and version information is written to text file.Its working fine if files in directory are less but problem arises when no...
0
by: coopdog | last post by:
This is a new issue as of an install to sp1 on vb express 2005. When I publish the application to my drive then I try to install it is wants to be installed from the same location as it was...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.