CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo [MVP]

Software management consultant and CTO, Headspring Systems

Reading in config files _one_ way - what's the path?

Executive summary:  AppDomain.CurrentDomain.SetupInformation.ApplicationBase

Subscribe here: http://feeds.feedburner.com/jeffreypalermo.

In a console app, this directory is where the assemblies are.  In ASP.NET, this directory is where the web.config file is, not the assemblies.  Other methods seem to be less reliable and rely on the current directory.  This can change whether the code is executing stand-alone or through Visual Studio.  the above API seems to be very consistent.

Please share your experiences.



Comments

Loading “collocated” file dependencies at runtime | Aaron Lerch said:

Pingback from  Loading “collocated” file dependencies at runtime | Aaron Lerch

# January 10, 2008 8:51 AM

Aaron Lerch said:

Well the pingback beat me to it, but I have a post that lists some ways to determine "collocated" files (like .config files).

www.aaronlerch.com/.../loading-collocated-file-dependencies-at-runtime

# January 10, 2008 10:22 AM

Francois Tanguay said:

Just remember than in VS2008, runnint tests with VS Tests, this value leads incorrect results.

# January 10, 2008 12:31 PM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

This Blog

Syndication