title: Parsing a local XML Document in WPF (works in debug, fails once published)
body: <p>I am building a WPF application. Inside that application I am using the XmlReader class to parse several local XML files. The code I have written <strong>works perfectly</strong> during debugging, but fails once I publish the application and install it.</p>
  
  <p>I have the XML documents as CONTENT in build action, and I have them set to COPY ALWAYS.I can confirm that the XML documents are being deployed in my build and are in tact in the application folder once installed.</p>
  
  <p>What further confuses me is that I am using the same XmlReader code to parse RSS feeds from external websites in this application without problem. It only fails on the local XML documents.</p>
  
  <p>Does anyone know why my XmlReader would fail to parse local XML documents once the application is published?</p>
  
  <p>Here is a small snippet of my XmlReader code for referance:</p>
  
  <pre><code>XmlReaderSettings settings = new XmlReaderSettings();
              settings.IgnoreComments = true;
              settings.IgnoreProcessingInstructions = true;
              settings.IgnoreWhitespace = true;
              try
              {
                  settingsReader = XmlReader.Create("Resources/data/TriviaQuestions.xml", settings);
  
                  nodeNum = 0;
                  while (settingsReader.Read())
                  {
                      switch (settingsReader.NodeType)
                      {
                          case XmlNodeType.Element:
                              if (settingsReader.HasAttributes)
                              {
                                  for (int i = 0; i &lt; settingsReader.AttributeCount; i++)
                                  {
                                      settingsReader.MoveToAttribute(i);
                                      _feeds[nodeNum] = settingsReader.Value.ToString();
                                  }
                                  settingsReader.MoveToContent(); // Moves the reader back to the element node.
                              }
                              break;
                          case XmlNodeType.Text:
                              _questions[nodeNum] = settingsReader.Value;
                              nodeNum++;
                              break;
  
                      }
  
                  }
                  settingsReader.Close();
              }
              catch
              {
  
              }
  </code></pre>
  
  <p>Here is my XML</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Questions&gt;
      &lt;Question feed="http://entertainment.msn.com/rss/topboxoffice/"&gt;What movie has the top box office sales in the US right now?&lt;/Question&gt;
      &lt;Question feed="http://entertainment.msn.com/rss/topdvdrentals/"&gt;What is the top DVD rental in the US this week?&lt;/Question&gt;
      &lt;Question feed="http://entertainment.msn.com/rss/topalbums/"&gt;Which of the following albums is currently topping the charts?&lt;/Question&gt;
  &lt;/Questions&gt;
  </code></pre>