Compile error "unable to copy ....dll access denied" RRS feed

  • Question

  • I repeatedly have the following problem with Visual Studio 2015 Enterprise:

    1. I have 2 projects A and B, where B depends on (references) A.
    2. I compile them separately: first A then B.
    3. Every time I make changes in A, recompile A, and then try to recompile

    B, the recompilation of B fails: "unable to copy A.dll" … even if I am running

    VS as administrator.

    1. I have tried deleting the reference to A.dll in the solution for B and then

    readding  a reference to A.dll, but I still get the same darned  compile error.

    1. I have also tried "repairing" VS with the builtin repair function. That does not

    fix the problem.


    Has anyone else seen a similar problem or does anyone know a workaround for

    this problem?

    Saturday, October 31, 2015 1:47 AM


  • Hi,

    Thank you for posting in MSDN forum.

    It probably means that the file bin\A.dll is locked for writing by another process (possibly another instance of Visual Studio).

    You should try closing down all instances of VS and any other programs that could be attempting to read that file, then re-open Visual Studio and try to build again.

    If that doesn't work then you can try using Process Explorer

    I solved this problem by deleting the contentious files from bin folder and rebuilding the project.

    Another option: Please follow these steps below,

    1. Go to “bin" folder. In some cases it may be "\bin" - one level up of the current.
    2. View the properties of the dll file and see whether it is marked as "Read Only". If read only check box checked, uncheck it.
    3. This happens if the project is under any source control system.

    I look forward to receiving your test results.

    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    Sunday, November 1, 2015 11:09 AM