title: How to copy a file from the app bundle to another directory without System.UnauthorizedAccessException?
body: <p>I try to copy a file that is included in the app bundle as a resource to the temp folder on the iPhone. While this works on the Simulator, on the device I get an exception:</p>
  
  <blockquote>
    <p>System.UnauthorizedAccessException: Access to the path
    "/private/var/mobile/Applications/B763C127-9882-4F76-8860-204AFEA8DD68/Client_iOS.app/testbundle.zip"
    is denied.</p>
  </blockquote>
  
  <p>The code I use is below It cannot open the source file. </p>
  
  <pre><code>using(var sourceStream = File.Open("./demobundle.zip", FileMode.Open))
  {
      sourceStream.CopyTo(targetStream);
  }   
  </code></pre>
  
  <p>What is the correct way of copying a file into a destination stream?</p>