Build error: "Unable to copy file ... " / "Could not copy ..."

DmytroBondarenkoDmytroBondarenko Dmytro BondarenkoUSMember ✭✭

Hello!
I saw this problem when I used the Alpha channel, so I switched back to the Release channel.
Today I installed the latest version of the XF for VS (4.5.0.443) and Mac and I have been start getting that error again.

What I tried to fix that (non of this is working perfectly):
1. Clean & Rebild the solution
Sometime I get error like that -
Or some problems with connection to the Mac - https://bdfss.blob.core.windows.net/shots/2017-05-11_13-33-52-d11c3dbd-39b2-4f65-92a9-70a5ddc0924f.txt
2. kill all the Msbuild processes via 'tskill msbuild'
3. delete bin and obj folders manually (I never saw there locked files)
4. run VS as Administrator
5. restart VS and Mac

In general 1&2 could help me, but sometimes only the 5 can affect on the build process.

Really hard to do something with the project now. I have to spend a lot of time just for run the App.

Posts

  • LyndonHugheyLyndonHughey Lyndon Hughey USUniversity ✭✭✭
    edited May 11

    I'm also having this problem. Clean and rebuild works about 50% of the time. This issue is happening about once an hour. I updated to the latest stable build yesterday.

  • DmytroBondarenkoDmytroBondarenko Dmytro Bondarenko USMember ✭✭

    @LyndonHughey said:
    I'm also having this problem. Clean and rebuild works about 50% of the time. This issue is happening about once an hour. I updated to the latest stable build yesterday.

    try to reboot mac and restart vs. That works for me ~90% of the time.

  • TakYongKimTakYongKim Tak Yong Kim USMember

    I got a similar issue in VS 2017 Enterprise on Windows after updating yesterday.

  • DmytroBondarenkoDmytroBondarenko Dmytro Bondarenko USMember ✭✭

    I found solution. @TakYongKim @LyndonHughey
    Write an cmd script with del command that delete problem files and run it after error or each time before start project building.

  • jhorvjhorv Jim Horvath USMember ✭✭

    I've also been having this in VS 2017 Enterprise, ever since I installed the Stable update on the 10th.
    Using Process Explorer, I've found that it's always devenv.exe holding it open.
    This is really aggravating - when will it stop being such a fight to use this stuff?

  • MarkDownesMarkDownes Mark Downes USUniversity ✭✭

    I am also experiencing this issue on almost every build since downloading the latest Xamarin updates yesterday. I using Visual Studio 2015 on Windows. Fix for now is to run a batch file which deletes all bin/obj folders and then try again.

  • JohnMillerJohnMiller John Miller USForum Administrator, Xamarin Team Xamurai

    Hi All,

    I've filed a bug to track this issue here: https://bugzilla.xamarin.com/show_bug.cgi?id=56306

    Please add your details to the bug report and CC yourself. I'd like to know your version information, diagnostic build log (add as attachment) and also if you can provide a project that seems to reproduce this.

    Thanks!

  • LyndonHugheyLyndonHughey Lyndon Hughey USUniversity ✭✭✭

    Thanks @DmytroBondarenko I've taken the task kill command and added it as a post build routine. It'll provide a patch for now.

  • KarthikeyanSekarKarthikeyanSekar Karthikeyan Sekar USMember ✭✭

    @LyndonHughey Please Share your Valuable patch code

  • zahikramerzahikramer Issac Kramer ILMember ✭✭✭

    This error has also reports here:

    https://developercommunity.visualstudio.com/content/problem/54945/compilaion-fails-because-proces-cannot-access-dll.html?childToView=57392#comment-57392

    and here:

    https://developercommunity.visualstudio.com/content/problem/55110/could-not-copy-when-building-large-solution.html

    I think it was before 15.2 also...

    Please someone give me obfuscator tool to apply it on my solution with 30 projects (backend and frontend) and i'll send my project to debug.

  • LyndonHugheyLyndonHughey Lyndon Hughey USUniversity ✭✭✭

    @DmytroBondarenko I thought my post build code was executing properly but i was not. It was just not reporting an error. Unfortunately, the post build routine calls are more difficult than expected. I've now reverted back to having a permanent command window open so I can quickly run the "tskill msbuild" command.

  • PhilippeTPhilippeT Philippe Troller FRMember ✭✭
    edited May 17

    I am also experiencing this issue (with vs 2017 current release & vs 2017 preview).
    My "workaround" right now is to work only with one project at a time ( => compile, then unload all other related projects ). No more copy = no more bug ... :/

    PS : A fast fix would really be appreciated : This bug is really a productivity killer ...

Sign In or Register to comment.