Friday, August 10, 2012

Error: The Process Cannot Access the File Because It is Being Used By Another Process

Most of the Asp.Net (VS) developers might have faced and will be facing a problem in building the solution in Visual Studio with an error saying "Unexpected error creating debug information file at XXXXX. The process cannot access the file \bin\Debug\filename.pdb because it is being used by another process."

This means that the respective .pdb or .dll file is being used by some process. And in-order to build the solution the file must be either deleted in file system or the process which is associated must be killed.

The system won't allow to delete the file from file system anyways, the other option is to kill the respective process. But finding the respective process is not straight.

Here we have a nice tool "Process Explorer" to identify the process for which the file is being used using search in the tool and respective process can be killed as well.

Isn't it so useful and nice tool.