title: .NET BitmapSource is locking file
body: <p>I am using this C# code to access an image file in order to read metadata from it.</p>
  
  <pre><code>BitmapSource img = BitmapFrame.Create(uri);
  </code></pre>
  
  <p>Unfortunately the image file specified by <code>uri</code> becomes locked until the program ends. How do I prevent the image from being locked?</p>