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

Update: I finally found a solution! It is still a mystery why this error is happening, and why this solution(s) solve it, but I will post the solutions here, in case they helps others.   I found three different solutions: Open Mendix via CMD shell:  C:\Program Files\Mendix\\modeler> studiopro.exe If this does not work for you, add flags: C:\Program Files\Mendix\\modeler> studiopro.exe --enable-interactive-rest --log-level=debug Add flags to Windows Mendix shortcut (requires admin rights): In FileExplorer go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Mendix 9.24.3 Right click on the link file "Mendix Studio Pro 9.24.3.lnk" and open properties Add flags to Target: "C:\Program Files\Mendix\\modeler\studiopro.exe" --enable-interactive-rest --log-level=debug Open Mendix shortcut file via CMD shell: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Mendix 9.24.3>"Mendix Studio Pro 9.24.3.lnk"  If this does not work for you, add flags: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Mendix 9.24.3>"Mendix Studio Pro 9.24.3.lnk"  --enable-interactive-rest --log-level=debug   The --log-level=debug flag seems to be the important one.   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`?
8 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!


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.





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.


Update: Nothing solved my Problem, it still persists.


I tried the following:

- excluding my deployment dir from the Windows Defender AntiVirus scan (assuming this is the blocking process)

- pausing OneDrive, although my app is NOT saved in a OneDrive directory (assuming this is the blocking process)

- finding the culprit process with tools like Power Toys → no process using the deployment dir could be found

- deleting the deployment dir, saving the App in different locations, downloading Mendix again, using different Mendix versions, using different Mendix Apps, …

- not using SiemensUI resources package → it is currently not used in my App


What works: using a different laptop where I am not accessing Teams or Outlook. But this is in no means a long term solution, since I want to use Mendix on my work laptop.


Could anybody else resolve this problem? 


Hey Katharina Ecker,


While running your application some of the files of your project are open. Some of them include excel files java files or ellipse.

Else another approach would be restart your system and run.

If that too dont work - change the local host and run your application.

Hope you might find the solution for your application.


kill watchman.exe solved my issue (used for hot reloads of css changes)