日期:2013-09-10  浏览次数:20389 次

最近遇到一个比较棘手的问题,在编译完一个。NET项目后,遇到如下出错信息
After you compile your Web application, you may receive the following error messages in

the Microsoft Visual Studio .NET task list:

Could not copy temporary files to the output directory.
-and-
The file 'bin\mywebapp.dll' cannot be copied to the run directory. The process cannot

access the file because it is being used by another process.
-and-
The file 'bin\mywebapp.pdb' cannot be copied to the run directory. The process cannot

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


微软对此的解释为如下,
CAUSE
Typically, this problem occurs because of a trailing backslash at the end of the path that

is set for the root Web site. For example:

C:\Inetpub\wwwroot\
This causes the mechanism that copies the DLLs from your Bin directory to the Temporary

ASP.NET Files folder to fail. When this mechanism fails, the runtime loads the DLL

directly from the Bin directory rather then from the Temporary ASP.NET Files folder.

This problem may also occur if any virtual directories with trailing backslashes have

child directories that are marked as Web applications.



RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the

problem described in this article and should be applied only to systems experiencing this

specific problem. This fix may receive additional testing at a later time, to further

ensure product quality. Therefore, if you are not severely affected by this problem,

Microsoft recommends that you wait for the next Microsoft .NET Framework service pack that

contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain

the fix. For a complete list of Microsoft Product Support Services phone numbers and

information about support costs, please go to the following address on the World Wide Web:


http://support.microsoft.com/directory/overview.asp

NOTE : In special cases, charges that are normally incurred for support calls may be

canceled, if a Microsoft Support Professional determines that a specific update will

resolve your problem. Normal support costs will apply to additional support questions and

issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:
   Date         Time   Version             Size   File name
   --------------------------------------------------------------
   26-Mar-2002  04:35  1.0.3705.213      192,512  Aspnet_isapi.dll
   26-Mar-2002  04:30                     19,332  Aspnet_perf.ini
   26-Mar-2002  04:35  1.0.3705.213       24,576  Aspnet_regiis.exe
   26-Mar-2002  04:35  1.0.3705.213       28,672  Aspnet_wp.exe
   20-Mar-2002  12:31                      8,709  Smartnav.js
   20-Mar-2002  12:31                      7,003 &n