PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

Sharing resources with Windows Explorer
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2224
Page 1 of 1

Author:  aparkinson17 [ Fri Nov 16, 2012 5:02 pm ]
Post subject:  Sharing resources with Windows Explorer

I recently started using this library to do some quick PDF exporting procedures (which this has been great for - thanks for the great library!), and while working with it, I've stumbled across a bit of strange behavior:

While running some preliminary tests, I was having crashes when I attempted to save PDFs - or, more specifically, every subsequent time I tried to save. The first time I ran the application, things would work fine, but then when I tried to export the PDF again using the same filename in a future session, the application would crash with an exception saying "The process cannot access the file "..." because it is being used by another process".

Upon further investigation, I've come to realize that the issue was caused by having a Windows Explorer window open with a preview pane viewing the file. When I click away from that document, the issue goes away.


At this point I don't know whether this qualifies as a bug exactly - it's entirely possible that there is no way to identify that it is Windows Explorer using the file rather than some other process - so sorry if I've posted this in the wrong place. But I felt it was worth bringing to your attention regardless.

Author:  Thomas Hoevel [ Mon Nov 19, 2012 9:23 am ]
Post subject:  Re: Sharing resources with Windows Explorer

PDFsharp cannot access the file if it is locked by Windows Explorer (or Acrobat Reader). So it's not a PDFsharp bug.

If I click an AVI file in Windows Explorer to delete it, then I have to wait until the thumbnail preview shows - otherwise the file cannot be deleted because it is in use.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/