title: Hosting IE 8 In WinForms and Opening a PDF
body: <p>We have a form that hosts the WebBrowser control. That is the only control on the form.</p>
  
  <p>We pass the form the file path of a temporary PDF file and it does:</p>
  
  <pre><code>WebBrowser1.Navigate(Me._PathToPdf)
  </code></pre>
  
  <p>When the form is closing, it navigates away from the PDF file:</p>
  
  <pre><code>WebBrowser1.Hide()
  WebBrowser1.Navigate("about:blank")
  
  Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete
      Application.DoEvents()
      System.Threading.Thread.Sleep(50)
  Loop
  </code></pre>
  
  <p>Once the form is closed, the calling class then deletes the temporary PDF file.</p>
  
  <p>This process works great... until we installed Internet Explorer 8. For some reason, the combination of IE8 and Adobe Acrobat 8 (or 9) causes an extra file lock handle to be placed on the temporary PDF file. The extra lock handle does not go away until the entire application is shut down. I should also mention that there are no locks on the file until the file is opened by Acrobat.</p>
  
  <p>We can reproduce this on multiple machines and it is always the combination of IE8 and Adobe Acrobat Reader. We can install Foxit Reader 3 instead of Adobe Acrobat and things work fine. Likewise, we can run the app on a machine with IE7 and Adobe Acrobat, and things work fine. But, when you mix the magic potion of IE 8 and Acrobat, you end up with a mess.</p>
  
  <p>Can anyone tell me why I'm getting an extra file lock that persists until the end of the application?</p>
  
  <p>Thanks.</p>
  
  <p>An example application that demonstrates my problem can be found here: <a href="http://www.centrolutions.com/downloads/PDFLockProblemDemo.zip" rel="nofollow noreferrer">PDFLockProblemDemo.zip</a></p>