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
Solved

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

Posted on 2014-07-29
3
572 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
3 Comments
 
LVL 33

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Keyboard 2 41
SqlDataBase 7 53
Call Controller Action Method from ASPX 2 22
parsing xml using powershell 6 15
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…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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