By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,911 Members | 1,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,911 IT Pros & Developers. It's quick & easy.

error: Could not find a part of the path

P: n/a
Hello,
My code is this:

string fileName = "settings/tabs.xml";
XPathDocument doc = new XPathDocument(fileName);

However, instead of searching files under the current IIS directory, the IIS
give me this error:Could not find a part of the path
"C:\WINDOWS\system32\settings\tabs.xml".

Why IIS is searching for windows directory? Is there some settings went wrong?

Many Thanks

Jerry

--
help, help
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
try this:

string fileName = Server.MapPath("settings/tabs.xml");

the reason being XPathDocument requires an exact path, not relative Web
reference

so:
"c:\InetPub\wwwroot\MySite\Settings\tabs.xml"
rather than
"settings/tabs.xml"

HTH

"rouqiu" <ro****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hello,
My code is this:

string fileName = "settings/tabs.xml";
XPathDocument doc = new XPathDocument(fileName);

However, instead of searching files under the current IIS directory, the
IIS
give me this error:Could not find a part of the path
"C:\WINDOWS\system32\settings\tabs.xml".

Why IIS is searching for windows directory? Is there some settings went
wrong?

Many Thanks

Jerry

--
help, help

Nov 19 '05 #2

P: n/a
string filename = "/settings/tab.xml";
"rouqiu" <ro****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hello,
My code is this:

string fileName = "settings/tabs.xml";
XPathDocument doc = new XPathDocument(fileName);

However, instead of searching files under the current IIS directory, the IIS give me this error:Could not find a part of the path
"C:\WINDOWS\system32\settings\tabs.xml".

Why IIS is searching for windows directory? Is there some settings went wrong?
Many Thanks

Jerry

--
help, help

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.