File cannot be copied to the run directory
Quote:
The file 'DDSControls.dll' cannot be copied to the run directory. Access is denied
I got this error when I was trying to compile a web project. The requested operation failed because it is being used by another process. I am using Visual Studio. Any idea why this error message means?
Re: File cannot be copied to the run directory
This error occurs due to one of the following reasons:
- A reference that has the CopyLocal property set to true could not be copied to the directory from which the project is being run.
- A dependency of a reference with a CopyLocal property set to true could not be copied to the directory from which the project is being run.
- Any other file that needed to be copied locally cannot be copied to the directory from which the project is being run.
To solve this error:
- Check your computer's available disk space
- Check whether you are hitting the MAX_PATH limit imposed by the file system
Re: File cannot be copied to the run directory
This problem may occur when one of the assemblies that you compile is larger than 64 KB and one or both of the following conditions is true:
- Your solution contains projects that are compiled to the same output folder.
- The Copy Local property on one of the referenced assemblies or projects is set to False.
To work around this problem, do any (or all) of the following, as appropriate for your projects:
- Compile the outputs for individual projects to different folders. Visual Studio .NET 2002 and Visual Studio .NET 2003 do not support a common output folder.
- Set the Copy Local property for the referenced assembly or project to True.
- Verify that you do not have the Object Browser window open.
- Verify that you do not have the same project (or projects) open in another instance of Visual Studio .NET.
Re: File cannot be copied to the run directory
Simply follow the below steps:
1. Open the solution that references the assembly.
2. In Solution Explorer, locate the project that references the assembly.
3. Click the References node of the project.
4. Right-click the assembly reference, and then click Properties.
5. Set the Copy Local property to True:
6. Save the solution.
If the above method doesn't work then, I would suggest that you to upgrade your Visual Studio to 2008 edition.