New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files getting locked #1

ullmark opened this Issue Mar 12, 2015 · 3 comments


None yet
2 participants
Copy link

ullmark commented Mar 12, 2015

Hi there,
We are trying out this plugin but we're having an issue while running this in our CI environment. It seems that after being used, the plugin never releases the "OptimizePngDll".

So our CI environment says this while trying to deploy the code.

The process cannot access the file '...Website\Dianoga Tools\PNGOptimizer\PngOptimizerDll.dll' because it is being used by another process.

Do you have any suggestions here? Is that to be expected and we should make sure to run something like IISReset or is this a bug in the module.



This comment has been minimized.

Copy link

kamsar commented Mar 13, 2015

I have not run across this issue before and I'm doing CI deploys with it. But neither am I any P/Invoke expert so it could conceivably be a bug.

Are you copying the file always or only when it is changed?


This comment has been minimized.

Copy link

ullmark commented Mar 15, 2015

Yes, the CI is copying the file always. To try to solve it now, we addded an IISreset as a first step of the deploy process. Seems to solve the problem and since the dlls are replaced anyways. It shouldn't be a problem. But I wonder if there is a leak..

Maybe we could use more using around the streams, make sure they are disposed and closed correctly.

@kamsar kamsar closed this in 1c6343f Jul 3, 2015


This comment has been minimized.

Copy link

kamsar commented Jul 3, 2015

It's not a leak, using [DllImport] causes a lock. In vNext I switched to dynamically loading and unloading the DLL as needed, thus freeing the lock on it unless an active optimization is in progress.

kamsar pushed a commit that referenced this issue Aug 31, 2015

Merge pull request #1 from jammykam/size-check
Added additional checks, fixed check bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment