Search code examples
visual-studio-2008c++-cliaccess-denied

Visual Studio 2008 linker error: ALINK operation failed (80070005) : Access is denied


I have Visual Studio 2008 (9.0.30729.1 SP) installed on my computer and a build machine. On my computer, a project builds fine. On the build machine, I have started getting this error. ALINK operation failed (80070005) : Access is denied

This is incredibly irritating because it doesn't say Access TO WHAT??? is denied.

I've tried rebooting the machine, and changing the output directory of the project. It's a C++/CLI DLL. The project links with a large number of libraries so it's not really practical to extensively check everything it links with, but a quick scan of the project and nothing seems to be missing or locked.

Anyway I can figure out what the heck linker is complaining about? Sounds like a bug in the linker(1), but as I said I have the same Visual Studio installed in my PC and the project builds fine.

(1) You could argue that an error message that unhelpful IS a bug.


Solution

  • It's always good to have FileMon as a tool in your toolkit: it can log every file operation, and will help showing what exactly the linker wants to do with what file.

    (Find it at sysinternals.com)