views:

89

answers:

2

I am creating a method in a DLL that is going to be dropped into a web application.

The web application has a folder with a XML file in it:

/files/myfile.xml

My dll has to reference that DLL, but I can't hard code the path to the file obviously.

How can I reference that file and load a XmlTextReader with that file?

A: 

The simplest way that comes to mind would be to pass a filename parameter to the DLL's method from the web application. I'm sure you've already thought of this, but your question doesn't say what (if any) problems exist with that solution.

Cerebrus
I was hoping the DLL could figure that out on its own.
Blankman
+1  A: 

The best thing would be to have the path to the XML file be stored in a configuration file. Since both of your assemblies will be running in the same AppDomain they will both have access to the setting in the configuration file and you don't have to worry about hard-coding the path.

Andrew Hare