Microsoft KB Archive/811593

= BUG: Your build cannot continue because a file is in use =

Article ID: 811593

Article Last Modified on 3/6/2006

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition

-





SYMPTOMS
When you build an application, you receive an error message that indicates that the build cannot continue because a file is in use. This may occur in the following cases:
 * ProjectA has CopyLocal=False on its reference to ProjectB.
 * Projects in a solution build to a common output directory.

In both of these cases, the assemblies that are generated or referenced are greater than or equal to 64 kilobytes (KB).



CAUSE
When you start a project, and you set CopyLocal=False or you build to a common output directory, the locking behavior does not occur. As you continue to work with the project and your assembly grows, this behavior eventually occurs. The Microsoft .NET Framework common language runtime locks loaded assemblies that are greater than or equal to 64 KB. When an assembly becomes larger than 64 KB, the runtime pages the assembly in memory to improve performance.



RESOLUTION

 * Verify that CopyLocal is set to True on all project-to-project references.

Note True is the default setting in Microsoft Visual Studio .NET 2003. To change this property, follow these steps:
 * In Solution Explorer, click the reference name under References.
 * Under Properties, view the properties for that reference, and then make any appropriate changes.
 * Verify that all the projects in the solution build to different output directories. Each project should have its own output directory that is not written to by any other project that is in the same solution or that is in a different solution.

Note This is the default setting in Visual Studio .NET 2003.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbbug kbpending kbvs2005swept kbvs2005doesnotapply KB811593

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.