?
Solved

How Do You Read a XML File from a Visual Studio Project?

Posted on 2014-07-29
3
Medium Priority
?
610 Views
Last Modified: 2014-09-05
I need to read a XML file loaded into a Visual Studio Project.  How do you read the XML file from the Visual Studio project files?

Thanks,

Dan
0
Comment
Question by:danielolorenz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Expert Comment

by:ste5an
ID: 40226707
Drag it into your solution. Set the properties BuildAction=Content and Copy to Output Directory=Copy always. Then you can simply read it by e.g.
static void Main(string[] args)
{
  XDocument document = XDocument.Load(@"MyDocument.xml");            
  Console.ReadLine();
}

Open in new window

0
 
LVL 1

Accepted Solution

by:
karthickj25 earned 2000 total points
ID: 40226716
Are you trying to read .xml files added to project, or files with .proj extension?
0
 

Author Closing Comment

by:danielolorenz
ID: 40306156
Thanks
0

Featured Post

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question