Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: ASP.NET Does Not Copy Files from Bin Directory to Temporary ASP.NET Files Folder


Symptoms

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.
Additionally, the ASP.NET worker process (Aspnet_wp.exe) may hold a lock to dynamic-link libraries (DLLs) in the Bin directory.

↑ Back to the top


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 than 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.

For more information about whether a trailing backslash causes this problem, see the "More Information" section.

↑ Back to the top


Resolution

To resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
318836 INFO: How to Obtain the Latest .NET Framework Service Pack
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 Smartnavie5.js
26-Mar-2002 13:34 1.0.3705.213 1,183,744 System_web.dll
NOTE: This fix requires Microsoft .NET Framework Service Pack 1.

↑ Back to the top



WORKAROUND

To resolve this problem in all circumstances, remove the trailing backslash from the path that is set in the Internet Service Manager.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2).

↑ Back to the top


More Information

To verify whether a trailing backslash causes this problem, follow these steps:

  1. Add the following code to a Microsoft Active Server Pages (ASP) page that is located in the same directory as your ASP.NET Web application:
    <%= Request.ServerVariables("APPL_PHYSICAL_PATH") %>
  2. View the page in your browser. Notice that the path includes two backslashes (for example, C:\Inetpub\wwwroot\\mywebapp).

    The presence of two backslashes indicates that you included a trailing backslash in the path in Microsoft Internet Information Services (IIS). In this case, C:\Inetpub\wwwroot\\mywebapp indicates that you included a trailing backslash in the path of the root web.
NOTE: If you include extended or escapable characters in the physical path (such as # or %), you cannot copy the DLL. In this case, the DLL also fails to load.

↑ Back to the top


Keywords: kbnetframe100sp2fix, kbnetframe100presp2fix, kbhttpruntime, kbfix, kbdsupport, kbqfe, kbbug, kb, kbhotfixserver, kbretire, kbdeployment

↑ Back to the top

Article Info
Article ID : 319991
Revision : 5
Created on : 4/28/2018
Published on : 4/28/2018
Exists online : False
Views : 88