We have a form that hosts the WebBrowser control. That is the only control on the form.
We pass the form the file path of a temporary PDF file and it does:
WebBrowser1.Navigate(Me._PathToPdf)
When the form is closing, it navigates away from the PDF file:
WebBrowser1.Hide()
WebBrowser1.Navigate("about:blank")
Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Application.DoEvents()
System.Threading.Thread.Sleep(50)
Loop
Once the form is closed, the calling class then deletes the temporary PDF file.
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.
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.
Can anyone tell me why I'm getting an extra file lock that persists until the end of the application?
Thanks.
An example application that demonstrates my problem can be found here: PDFLockProblemDemo.zip