title: XMLReader.Create() fails with DirectoryNotFoundException
body: <p>I have this ASP.NET app and some code in it that is trying to load an xml file. So, its gets to a XMLReader.Create() call which throws a DirectoryNotFoundException. </p>
  
  <pre><code>
  [DirectoryNotFoundException: Could not find a part of the path 'F:\webroot\fs.apps\data.FusionWeb\docs\Xmls\FeedList.xml'.]
     System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +281
     System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1242
     System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +127
     System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) +125
     System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +80
     System.Xml.XmlTextReaderImpl.FinishInitUriString() +89
     System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) +102
     System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) +61
  </code></pre>
  
  <p>This is happening only when only when published and running on IIS 10 and the Uri (the F:\ .... thing above) passed in is a mapped network drive (that is F: drive mapped to a share back to the same machine the web server runs on). If the same thing is ran from Visual Studio with IIS Express there's no problem, it will read the file just fine. </p>
  
  <p>If I setup the application to use a local disk folder, in that situation it works too. I am running the application as ApplicationPoolIdentity and I gave the corresponding IIS AppPool\nameoftheapppool account modify rights on the folder, subfolders and files. I checked the user with Environment and HttpContext and it shows in both scenarios (working or not) the same logged in user (impersonating it of course) who has access to that location.
  I ran Procmon and I couldn't catch any trace of an access by w3wp.exe to F:... .
  At last I tried using a unc path \\machine\share... and this works running off of IIS 10 but this is not something I can use because various reasons that would take too long to explain. </p>
  
  <p>It really comes down to an ASP.NET web forms app running off of a IIS 10 and trying to load an XML file, more precisely XMLReader.Create() call failing when the uri passed in is a file on a mapped network drive.</p>
  
  <p>One other thing that bugs me is that this exception is not even mentioned as a potential exception  </p>