Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 19, 2012 07:02 AM by nijhawan.saurabh
Member
523 Points
1220 Posts
Apr 19, 2012 06:56 AM|LINK
Hello,
I have this module app and the xelement.load is buggy. It does not correctly map the file. Why?
Dim store = From c In XElement.Load("App_Data/xml_path/shoe_data.xml").Elements("shoes") Select c
Error "Could not find file 'C:\Users\UserName\Documents\Visual Studio 2010\Projects\Module1\bin\Debug\App_Data\xml_path\shoe_data.xml'."
The error states that it cannot find the xml file under the bin/Debug folder but the file resides in the root project.
Thank You
Contributor
3712 Points
838 Posts
Apr 19, 2012 06:58 AM|LINK
You need to use XDocument.Load() instead of XElement. And also use Server.MapMap("~/App_Data/xml_path/shoe_data.xml") as the path
All-Star
16430 Points
3173 Posts
Apr 19, 2012 07:02 AM|LINK
"~/App_Data/xml_path/shoe_data.xml"
imperialx
Member
523 Points
1220 Posts
XElement.Load not working
Apr 19, 2012 06:56 AM|LINK
Hello,
I have this module app and the xelement.load is buggy. It does not correctly map the file. Why?
Dim store = From c In XElement.Load("App_Data/xml_path/shoe_data.xml").Elements("shoes") Select cError "Could not find file 'C:\Users\UserName\Documents\Visual Studio 2010\Projects\Module1\bin\Debug\App_Data\xml_path\shoe_data.xml'."
The error states that it cannot find the xml file under the bin/Debug folder but the file resides in the root project.
Thank You
Knecke
Contributor
3712 Points
838 Posts
Re: XElement.Load not working
Apr 19, 2012 06:58 AM|LINK
You need to use XDocument.Load() instead of XElement. And also use Server.MapMap("~/App_Data/xml_path/shoe_data.xml") as the path
.NET Developer (ASP.NET, MVC, WPF) MCTS .NET 4 (Web, WCF)
Blog | Twitter
nijhawan.sau...
All-Star
16430 Points
3173 Posts
Re: XElement.Load not working
Apr 19, 2012 07:02 AM|LINK