title: Getting the current directory in an assembly used by a web service app and windows service
body: <p>I have an assembly that reads a configuration file which is in the application directory.</p>
  
  <p>This assembly is used from a windows service and a web service.</p>
  
  <p>From the windows service the following works:</p>
  
  <p>string ConfigFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MyFile.config");</p>
  
  <p>However from the webservice, baseDirectory is the directory before the bin directory where the config file is.</p>
  
  <p>So how do I make the assembly find the file for both a windows service and a web service?</p>
  
  <p>Thanks
  JD.</p>