title: WebApi - How to include relative paths for included App_Data XML files?
body: <p><strong>Question Background:</strong></p>
  
  <p>I have a WebApi controller who's logic code relies on reading data contained in a number of XML files. These XML files have been included in the <code>App_Data</code> folder of the WebApi project.</p>
  
  <p><strong>The Issue:</strong></p>
  
  <p>I'm trying to use the relative path of the XML files in the following way:</p>
  
  <pre><code>    [System.Web.Http.HttpGet]
      public string CallerOne()
      {
          string docOne = @"~\AppData\DocOne.xml";
  
          string poll = @"~\AppData\Poll.xml";
  
          var response =  _Caller.CallService(docOne, poll);
  
          return ConvertXmlToJson(response);
      }
  </code></pre>
  
  <p>When running the WebApi code and calling the Url to the <code>CallerOne</code> method I receive the following error:</p>
  
  <pre><code>An exception of type 'System.IO.DirectoryNotFoundException'
  occurred in  System.Xml.dll but was not handled in user code
  
  Additional information: Could not find a part of the path
  'C:\Program Files  (x86)\IIS Express\~\AppData\FPS.xml'.
  </code></pre>
  
  <p>I also want to eventually publish this to Azure and include these files.</p>
  
  <p><strong>How can I use the relative path to read in the XML files in the <code>App_Data</code></strong> folder?</p>