title: Using embedded resources in C# console application
body: <p>I'm trying to embed an XML file into a C# console application via Right clicking on file -> Build Action -> Embedded Resource.</p>
  
  <p>How do I then access this embedded resource?</p>
  
  <pre><code>XDocument XMLDoc = XDocument.Load(???);
  </code></pre>
  
  <p><strong>Edit:</strong> Hi all, despite all the bashing this question received, here's an update. </p>
  
  <p>I managed to get it working by using </p>
  
  <pre><code>XDocument.Load(new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Namespace.FolderName.FileName.Extension")))
  </code></pre>
  
  <p>It didn't work previously because the folder name containing the resource file within the project was not included (none of the examples I found seemed to have that).</p>
  
  <p>Thanks everyone who tried to help.</p>