Problem with blocked file access
-
Hello all, I am using a foreign dll to read some data out of a certain file. The problem is: This dll somehow doesn't release the file once you open it to read the content with the dll. So after reading the data out of a file it is blocked for write-access until I completely close my whole application. My question is: How can I release these files? What I already tried: - setting all involved objects null - calling the GC manually - simply waiting some time hoping that .NET will release the file Nothing helped. Any ideas? Best regards, Bertram Weckmann Development Team G10 Software AG www.svizzer.com
-
Hello all, I am using a foreign dll to read some data out of a certain file. The problem is: This dll somehow doesn't release the file once you open it to read the content with the dll. So after reading the data out of a file it is blocked for write-access until I completely close my whole application. My question is: How can I release these files? What I already tried: - setting all involved objects null - calling the GC manually - simply waiting some time hoping that .NET will release the file Nothing helped. Any ideas? Best regards, Bertram Weckmann Development Team G10 Software AG www.svizzer.com
Does code in the DLL that reads from the file call Dispose? If not, then you have no choice but to force garbage collection and finalization, with code like
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
Does code in the DLL that reads from the file call Dispose? If not, then you have no choice but to force garbage collection and finalization, with code like
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();Regards Senthil _____________________________ My Blog | My Articles | WinMacro