WinForms app.config path

J

Jon

Hello all,

In a WinForm application I need to return the file path of the
app.config file.

How would I do this?

Thanks all,

Jon
 
N

Neil Barnwell

You could use either:

Application.StartupPath

or

Assembly.GetExecutingAssembly().Location
 
G

Gregory A. Beamer

In a WinForm application I need to return the file path of the
app.config file.

The app.config will be located in the directory specified by
Application.StartupPath. I know of no exceptions to this rule, although
someone please correct me if there is.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top