The process cannot access the file

D

dave

Frequently getting the compile error:

"The process cannot access the file because it is being
used by another process."

The files that .NET is trying to reference are the PDB
and DLL that I am trying to compile.

The "Process Explorer" utility by SysInternals shows that
it is actually .NET (Devenv.exe) that has the DLL/PDB. I
only have 1 instance of .NET running. Seems to be
contending with itself.

Any idea what is causing the error and how it can be
solved?
 
F

Felix Wang

Hi Dave,

Thanks for posting. Could you let us know what kind of project you are
building? Does it have reference to another project in the same solution?
Are you using VS.Net 2002 or VS.Net 2003? The problem may also occur if we
have 2 projects' output being built to the same folder.

Here are some related knowledge articles. They almost cover every possible
cause of this error. Please check and see whether they apply or not:

PRB: Dependent Assembly is Locked When Building
http://support.microsoft.com/?id=326997

FIX: ASP.NET Does Not Copy Files from Bin Directory to Temporary ASP.NET
Files Folder
http://support.microsoft.com/?id=319991

BUG: "Could Not Copy Temporary Files to the Output Directory" Error Message
When You Build a Solution That Contains Multiple Projects
http://support.microsoft.com/?id=313512

PRB: The "Could Not Copy Temporary Files to the Output Directory" Error Is
Generated in Visual Studio .NET
http://support.microsoft.com/?id=311491

I hope these make sense to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
G

Guest

Thanks for the great ideas:

1. What kind of project? Does it have reference to
another project in the same solution? The solution
contains 11 projects. The main project is a Windows
Application and the others are Class Libraries. It is
common for 1 project to reference others.

2. 2002 or 2003? VB.NET 2003.

3. All of the projects have their output going to
the "bin\" path. Each project was built in a separate
folder.

I tried the recommended solutions in each of the articles
but nothing seemed to work. I did delete the dll with
the contention after closing VS.NET and have not been
able to reproduce the problem since. Any thoughts?
Again, thanks for your help.
 
F

Felix Wang

Hi Dave,

Thanks for your update. However, I am a little bit confused.

You mentioned that "I did delete the dll with the contention after closing
VS.NET and have not been able to reproduce the problem since". Did you mean
that the problem was solved by deleting the DLLs and rebuilding?

I have not encountered this situation before.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
D

Dave

You are correct. I deleted the problematic file after
closing .NET. Then, after re-loading and re-building the
solution, the problem has not re-occurred.
 
F

Felix Wang

Hi Dave,

Thanks for your clarification. I cannot tell what causes this problem. It
seems to be related to building order or references. Anyway, I am glad to
hear that it has been resolved.

Have a nice day.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top