I feel kinda stupid to even ask that question, But i was sitting like an hour trying to figure out how to solve the problem. I am currently making a project that uses ASP.NET and XML, for my project i created new web site from Visual Studio, and trying to keep my XML files in App_Data.
However when i trying to use code:
var topic = from t in XElement.Load("App_Data/topics.xml").Elements("topics")
select new
{
topic_id = t.Attribute("id"),
topic_subject = t.Element("topicname"),
topic_short_body = t.Element("topicshortbody")
};
I am getting an error :
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\App_Data\topics.xml'.
Source Error:
Line 23: {
Line 24:
Line 25: var topic = from t in XElement.Load("App_Data/topics.xml").Elements("topics")
Line 26: select new
Line 27: {
Source File: d:\college\xml\xmlproject\Default.aspx.cs Line: 25
I am absolutely sure that my file in App_Data. So my question is there other way to specify path, or how it would be in my case proper way to specify the path ?
Thank you in advance.