Color scheme: Dark
You are here: start » en » Documentation » Microsoft Access development tools » WKL Office SDK » Troubleshooting » A file is in use by another program

A file is in use by another program

wkl-office ends with error: <file> is in use by <program> (<process id>); close it there and run again. (exit code 5), dotnet build fails with error WKL011 and the same text, or an operation of the Access add-in reports it in the tab Output.

Environment

WKL Office SDK 0.2.0 and later, every command that reads the sources or writes the build output.

Cause

Another program holds a file of the project open without sharing it: an editor that locks the file it shows, a virus scanner checking a file just written, a second Access with the built database open, a backup or synchronisation tool. The step stops because it can neither read nor replace the file. The message names the file and the programs that hold it, as Windows reports them (Restart Manager); when Windows cannot tell, it says “another program”.

The database open in your own Access is not such a case: the commands that need it work with that Access, and a build that would replace it reports The build cannot replace the database.

Resolution

  1. Close the file in the named program, or wait until the virus scanner or the synchronisation has finished.
  2. Run the command again.
  3. If the same file is held again and again by a virus scanner or a synchronisation tool, exclude the project folder (or at least build and obj) from it, as is usual for source folders.
en/wiki/msaccess/sdk/troubleshooting/a-file-is-in-use.txt · Last modified: by Wolfgang van der Stille