How to resolve build error: Unable to copy file. Access to the path is denied - visual-studio

The full error is this:
Error Unable to copy file "C:\TFS.WorkSpace\Argosy\Argosy\Base\Interop\Microsoft.Vbe.Interop.dll" to "..\ArgosyBuild\Interop\Microsoft.Vbe.Interop.dll". Access to the path '..\ArgosyBuild\Interop\Microsoft.Vbe.Interop.dll' is denied.
About 20 developers are working on a same TFS based solution and I'm the only one with this recurring problem.
Things I've tried are cleaning solution and deleting entire folder and downloading again with no effect. The only thing that works is selecting build folder and removing the read only flag from files. But, this solution only works one time. Next build will return some of the flags every time.
We have about 30 referenced dll's in our solution. Those dll's are with the solution and not in GAC and their build action is set to: Copy always. I always get about 2-7 dll's with this error randomly chosen.
Any help will be appreciated, thank you.

You stated ...
The only thing that works is selecting build folder and removing the
read only flag from files.
Have you tried to change the read only flag on the folder that holds these files?

I worked with the "clean" option by right clicking on the project

Related

visual studio keeps adding a _1 to a project name crashing the build

I created a project, lets say named AddonLib, which is part of a big solution. For some unknown reason, the folder where the source code was put was named AddonLib_1. I've been trying to get rid of that "_1" for too long now and is driving me crazy. Things I've tried:
removed the project, from TFS and the solution. Renamed the directory. When I try to add the project again, I get the message "The project file "blabla\AddonLib_1\AddonLib.vcxproj" has been moved, renamed or is not on your computer".
Edited the xml file of the solution. Check the project file just to be sure. Removed any trace of the project with and without _1. The project AddonLib is no longer part of the solution. Try to add it back again, same error as before.
Cleared the VS cache following the instructions here. Repeated previous step. Same error.
I cannot find any reference to AddonLib_1 on my code, xml files, anything. But everytime I try to load the project, I get the same error.
Looking for the string "AddonLib_1" using findstr gives no results...
This causes the build to break. Even if there are no references (that I can find) to AddonLib_1, when building in the server I get an error "project AddonLib_1/AddonLib.vcxproj could not be found blablabla"....
Besides the solution xml file, the project xml file, the xml files of the few projects that depend on this project, where else can the information that once the project was in the directory AddonLib_1 ?
More info:
I can remove the project. Remove it from TFS, from the solution, and delete the directory. Create a new project with the desired name. Add the source and header files. Now, I need to add some info to the project xml file. If I open the xml file and edit, when I try to load back the project (Which was loaded before!) I get the same error message. If I open the xml again, undo the minor change I did, I still get the error. Again, this is in a new project, starting from zero.
I was able to solve this issue by removing the .suo file as described in this apparently unrelated answer

Could not copy the file "..\HiQPdf.dep" because it was not found

I get this build error after trying to use HTML to PDF Converter Library for .NET. I copy over the dll, dep and xml files from the ZIPped folder downloaded from the website but when I compile my code, the HiQPdf.dep disappears.
The FAQs from the website say to change the execute permissions of the HiQPdf.dep file but after i do this, it still doesn't work.
How can i get rid of this error?
I resolved this by changing the execute permissions on the HiQPdf.dep file and then changing it to read-only. I don't see how this is a stable or logical fix but it is working now.
I solved this issue by just removing & re-adding the dll.

Flex error, unable to load SWC

Need help in a very weird error in Flashbuilder where a SWC seems to magically appear and is giving me errors. All the updates to the SWC is not being recognised by Flashbuilder.
In my Libs folder, there is no ._controls.swc file in it but in the build path in Flashbuilder, it just magically appears and is giving me errors, which i suspect is what causing my original controls.swc to not be able to update its library of movieCLips in it.
Any idea what could have cause this?
I just manage to get it working by removing the libs folder from my source and not from the flashbuilder. then creating a new folder and copy over the swc files into the new folder. then it works. so i guess there must have been some weird hidden file in the folder..
thanks for all the suggestions.
Try to Clean your project go to Project>Clean, I think this may work for you!!

Xcode 4 gcc failure on Archive build: skips precompile step?

I have been able to Archive on Xcode 4 successfully, but all of a sudden (??), I can't. The build fails with an invalid .pch file. The error is pasted in below (got from a reattempt with -Winvalid-pch, but what seems to be happening from the build log is that the precompiled header is not actually getting precompiled-- it's an iOS app, and goes straight from a CopyPNG step to a .m compile.
Could I have flipped something by accident? Nothing seems odd in my diff of the .pbxproj file.
cc1obj: warning: /Users/myname/Library/Developer/Xcode/DerivedData/Foo-afikuaovoaeqhreaaaakpafseuuv/Build/PrecompiledHeaders/Foo_Prefix-guqixmujoiaaaacwjctfkrztxmbz/Foo_Prefix.pch.gch: created by a different GCC executable
cc1obj: error: /Users/myname/Library/Developer/Xcode/DerivedData/Foo-afikuaovoaeqhreaaaakpafseuuv/Build/PrecompiledHeaders/Foo_Prefix-guqixmujoiaaaacwjctfkrztxmbz/Foo_Prefix.pch: No such file or directory
cc1obj: error: one or more PCH files were found, but they were invalid
The "Precompile Prefix Header" build setting is "Yes" for all configurations. Product->Clean doesn't help. Deleting the cached pch stuff under derived data doesn't fix it. Really seems like the whole "precompile" step is missing.
Another factoid: Enabling the setting "Increase Sharing of Precompiled Headers" DOES let it succeed. But I can find almost no reference to what this flag really does, and I have never used it before. And perhaps reasonably, the precompile step still doesn't show up when this happens.
Have you cleaned and then rebuilt? Product Menu ==> Clean. Cleaning usually solves such problems, effectively instructing Xcode to compile everything, regardless of whether it thinks the previous build of that file is still valid.
If that fails, try wiping out the Derived Data folder for the project, at ~/Library/Developer/Xcode/DerivedData/YourProjectNamexxx where xxx is a uuid-style string.
The approved answer is correct, just a note that it works only in some cases.
I just converted a project into workspace and changed Derived Data Location from default to Workspace-relative. Precompiled headers stopped working immediately and cleaning the old location didn't seem to make any difference. Well of cource, since it was the OLD location!
Workspace relative location seems to located inside folder, where the workspace file (myProject.xcworkspace) was saved. There's now new subfolder DerivedData, which contains folder named by workspace, which contains the familiar stuff.
Index folder contains the PrecompiledHeaders, which contains (finally) the several subfolders. Deleting all of those and recompiling forced precompiling happen.

Build error with VC6

When I build my application in VC6 IDE, I get this error:
--------------------Configuration: all - Win32 PRO Unicode Release--------------------
The system cannot find the file specified.
Error executing c:\windows\system32\cmd.exe.
all.exe - 1 error(s), 0 warning(s)
I don't have any custom build commands, and this error is particular to this specific project only. Please help.
The Build error was due to the unload of one of our sub-project dsp in our VC dsp file.
We unloaded a sub project that was not required for build. but we didnt remove it from project dsp.
( actually we have series of sub - project dsp files to be built with the main dsp file)
Once it was loaded and built again, the error vanished. Thanks for your suggestions and answers.
Didnt get the reason, but it solved the problem.
It is likely you have a custom build command in one of your applications dependencies.
Review them all, and in each one that has anything, add an ECHO ON as the first step.
Then when you do your build, you will see the details of what command is failing.
The most common problem I have, is when i try to copy header files to a common location automatically. I sometimes get the relative path wrong. Adding a DIR to the post build
is an easy way to show where you are, and can help correct path errors.
you may be deleted your environment variable
I changed the build mode from from Win32 Simulation to Win32 Debug and clicked on "Rebuild All" and it worked.

Resources