I have a config file that I need to load as part of the execution of a dll I am writing.
The problem I am having is that the place I put the dll and config file is not the "current location" when the app is running.
For example, I put the dll and xml file here:
D:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\bin\Plugins
But if I try to reference the xml file (in my dll) like this:
XDocument doc = XDocument.Load(@".\AggregatorItems.xml")
then .\AggregatorItems.xml translates to:
C:\windows\system32\inetsrv\AggregatorItems.xml
So, I need to find a way (I hope) of knowing where the dll that is currently executing is located. Basically I am looking for this:
XDocument doc = XDocument.Load(CoolDLLClass.CurrentDirectory+@"\AggregatorItems.xml")