5

I get the following errors when building with Visual Studio 2013 (Update 3) several projects:

Could not copy the file ".." because it was not found.

Could not copy ".." to "..". Exceeded retry count of 10. Failed.

Unable to copy file ".." to "..". The process cannot access the file ".." because it is being used by another process.

I noticed with "Unlocker" that for some strange reason that "QTAgent32.exe" is blocking some of those files.

This seems to be a big issue:

https://connect.microsoft.com/VisualStudio/feedback/details/533411

Visual Studio "Could not copy" .... during build

Community
  • 1
  • 1
carraua
  • 1,398
  • 17
  • 36

2 Answers2

3

Uninstalling the "Productivity Power Tools" extension in Visual Studio 2013, restarting Visual Studio and rebuilding did it for me. I found this workaround here:

https://connect.microsoft.com/VisualStudio/feedback/details/533411

carraua
  • 1,398
  • 17
  • 36
  • I tried this and I still get the error. In fact, I can easily re-produce this error anytime simply by Cleaning the Solution and then Rebuilding the Solution. – BradH Jul 06 '15 at 16:58
0

This is due to a circular dependency in your code; look for something like:

public record foo
{
    foo parent;
    public foo(foo parent){ this.parent = parent; }
}

foo f1 = new();
foo f2 = new foo(f1);

Garbage collector will not collect, causing Visual Studio to fail. Make sure you set the parent to null or don't use circular dependencies.

public record foo : IDisposable
{
    foo parent;
    public foo(foo parent){ this.parent = parent; }
    void Dispose(){ parent = default; }
}

//this is ok
using foo f1 = new();
using foo f2 = new foo(f1);

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83