Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XmlDocument.Load() Relative Path
Message
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
00870577
Message ID:
00873258
Views:
26
Hi Bill,

To read a file in the same directory as the DLL then you don't need to supply any path. For example:

ds.ReadXml("chapters.xml");

reads the file "chapters.xml" from the same directory that contains the dll.

>Hi Hector,
>
>I have tried some of the options like these w/o success but I will look at these specific functions also. Since it's a DLL, things like CurrentDirectory were returning the System32 dir.
>
>>Perhaps Application.StartupPath and/or system.Reflection.Assembly.GetExecutingAssembly.GetName() might help you here.
>>
>>
>>>When using the XmlDocument.Load() method from a DLL, is it possible to use one of the overloads with a relative path (to the location of the DLL) to retrieve an XSLT document?
>>>
>>>I need to load an XSLT document and I do not want to hard code the path or, if possible, not have to load the path into a config file. I would like to place the XSLT file in the DLL bin dir or possibly one level up and load it from there. Is it possible to retrieve this path in the running DLL w/o specifying it in a config file?
>>>
>>>Thanks,
>>>Bill
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform