FIX: "Cannot copy assembly" error message during the build process after you use the Get Latest command to retrieve solution files from Visual SourceSafe

Article translations Article translations
Article ID: 843370 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

If you build a Microsoft Visual C# .NET solution after you have used the Get Latest command to retrieve the solution files from Microsoft Visual SourceSafe, you may receive the following error message when you build the solution:
Cannot copy assembly 'Referenced Assembly' to file 'Current Project Output Folder\bin\Debug\Release\Referenced Assembly.dll'. The process cannot access the file because it is being used by another process.
This error causes the build to fail. The error message means that the referenced assembly is the output of another project in the solution.

CAUSE

The problem occurs because the file that contains the referenced assembly is locked by another process. The IDE opens a handle to the file and then does not close the handle as expected. Therefore, the IDE cannot update the file. This file will remain locked until you restart the development environment.

It is a good idea to verify that you are not building all your assemblies to the same output directory. For additional information about conditions that may cause dependent DLLs to be locked during a Microsoft Visual Studio .NET build, click the following article number to view the article in the Microsoft Knowledge Base:
313512 BUG: "Could not copy temporary files to the output directory" error message when you build a solution that contains multiple projects

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Visual Studio .NET 2003 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

File information

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time  Version      Size     File name
   ------------------------------------------------------
   02-Jun-2004  8:37  7.10.4154.0  794,624  Cslangsvc.dll

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 843370 - Last Review: May 15, 2006 - Revision: 2.2
APPLIES TO
  • Microsoft Visual C# .NET 2003 Standard Edition
Keywords: 
kbqfe kbbug kbfix kbvsnet2003presp1fix kbhotfixserver KB843370

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com