title: C# UWP UnauthorizedAccessException - Access to path is denied
body: <p>I'm trying to write a list to a txt file via the following code with my UWP app:</p>
  <p>string filePath = @&quot;C:\receipt.txt&quot;;
  File.WriteAllLines(filePath, output);</p>
  <p>but I get the following error:
  System.UnauthorizedAccessException: 'Access to the path 'C:\receipt.txt' is denied.'</p>
  <p>I've run VS as admin and added an app manifest and adjusted  but still no luck.</p>
  <p>Any help would be greatly appreciated.</p>
  <p>Edit:
  I added the broadFileSystemAccess to the program and allowed it permissions through windows settings but still get the same error.
  Also I changed it to @&quot;C:\Receipts\receipt.txt&quot;; but still no luck. Works fine with framework console app but I think that's because UWP doesn't have same access (at least from what I read online)</p>