Solved

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

Posted on 2014-07-29
3
548 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 32

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now