Solved

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

Posted on 2014-07-29
3
589 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 34

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 500 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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. 
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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