An error occurred while deploying: process cannot access file already in use

Update : I reported the error 8 month ago and since then I tried the suggested solutions, as well as updated from 9.12.1 to 9.18, and recently, to 9.23, but the problem is still not solved.   I am trying to locally deploy my app. At random, the following error appears:  Sometimes it appears within minutes, sometimes I am blocked from working for over 30 minutes. At some point, the error just disappears.  I tried already the following, but could not solve the problem: - cleaning my deployment dir - deleting my deployment dir - closing any open windows / browsers - update , as suggested I moved my local Mendix directory under Documents, but it did not resolve the error Can somebody help`?
5 answers


Try to kill/stop the Java.exe process.

or the .lock file (<your project>.mpr.lock) and then try to deploy.


Hope this helps!




I still have the above described error message when deploying locally.


I tried as suggested:

- to move my local Mendix directory to Documents

- removing the .lock file

- I tried in addition updating Mendix: First from 9.12.1 to 9.18 and now to 9.23. But the problem still persists.


And it gets even more annoying, the error appears now almost every time I try to deploy locally and it often takes me more than 30 minutes of trying until I am able to deploy. And if I change something and redeploy, the problem starts again making my work with Mendix very cumbersome and time intensive.



Are you using a tool like Microsoft OneDrive? 

This causes problems as it is trying to backup the deployment directory while Mendix is using it for building the application. 

If you are using OneDrive, I would suggest downloading a clean copy from version control to a directory outside OneDrive and try building again.

Good luck!


Hi Katharina,


In PowerToys there's a feature that adds a ‘What's using this file?’ option to the right click context menu. You can try using that to see which process is currently using the file. Perhaps that'll provide some insight. Just download and install PowerToys, navigate to the file that the error mentions and right click the file to inspect it.


There is almost certainly something else accessing those files in real time apart from Mendix Studio Pro. 


In my previous answer, I mentioned OneDrive as this is a very common tool that could interfere with files, but there are others. Do you have any sort of real-time antivirus or malware scanner running for example? That could be accessing the file while Mendix is building the application and causing problems.

You mentioned that nothing seems to have a lock on the file when you look, but that could be that the other process or application that accessed the file has finished with it by then, but Mendix still believes it is locked.

If you have any real-time scanning or backup programs, try disabling them all temporarily.