What is the application path for class library assembly?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a xml config file for my class library assembly. The problem is that I can't seem to find out where the application will be running. I want to place the xml file in the /bin directory where the assembly would be.

I tried Application.StartupPath but it does not work. Any suggestions?
 
Hi Chris,

You might try using Assembly.Location method.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Chris said:
I am trying to create a xml config file for my class library assembly.
The problem is that I can't seem to find out where the application will be
running. I want to place the xml file in the /bin directory where the
assembly would be.
 
Hi Chris,

I did mean that an instance of Assembly has a Location property.
Assembly a;
string path = a.Location;
 
Chris,

Try the following:

AppDomain.CurrentDomain.SetupInformation.ApplicationBase

Hope this helps.
--
Jeffrey Wynn
(e-mail address removed)


Chris said:
I am trying to create a xml config file for my class library assembly.
The problem is that I can't seem to find out where the application will be
running. I want to place the xml file in the /bin directory where the
assembly would be.
 
Back
Top