Visual Studio 2015 "Can't copy" problem since updating Xamarin to v4.5.0.443

JosHuybrighsJosHuybrighs USMember ✭✭

Since I updated the Xamarin extension in Visual Studio 2015 to 4.5.0.443 (with Xamarin.Android being v7.3.0.13) Visual Studio continuously complains about not being able to copy portable library .dll files from .obj to .bin. Manually deleting the .dll files in the bin directories sometimes solves the issue but it keeps on re-appearing when doing new builds. Often however I can't delete the files and I get the message "Operation cannot be completed because the file is being opened in Visual Studio".

I am currently only testing on the android emulator and the issue almost always comes up when I force the debugged app to stop (using the "Stop debugging" menu in VS).

I am using xamarin.forms v2.3.4.231

Any idea? A temporary fix?

Best Answer

Answers

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    @JosHuybrighs,

    Could you post the full error message? You can edit out the project/app name if that's private.

    Also, confirm if restarting VS temporarily resolves the issue.

  • JosHuybrighsJosHuybrighs USMember ✭✭

    This is becoming extremely frustrating. Manually deleting the bin files doesn't always work, restarting VS doesn't always work. What has worked is: wait 1 to 2 hours and then do a re-build.
    Seeing this makes me wonder whether Xamarin.forms with Visual Studio will be a good idea to do development on. At this point in time I am hesitating to recommend it to anyone.

    Is there a way to go back to an earlier version of the Xamarin extension?

  • JosHuybrighsJosHuybrighs USMember ✭✭

    See the following 'output' messages. The project has 2 portable library projects and 1 android project.
    And no, restarting VS does not resolve the issue. I have to manually delete the dll files or, as I experienced the last hour, wait some time (can't say for sure how long, but 10 to 15 minutes) and then do a re-build.
    Apparently others are also complaining about this: here

    1>------ Build started: Project: CrossPlatform, Configuration: Debug Any CPU ------
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 2 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 3 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 4 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 5 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 6 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 7 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 8 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Beginning retry 10 in 1000ms. The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): error MSB3027: Could not copy "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". Exceeded retry count of 10. Failed.
    1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): error MSB3021: Unable to copy file "obj\Debug\CrossPlatform.dll" to "bin\Debug\CrossPlatform.dll". The process cannot access the file 'bin\Debug\CrossPlatform.dll' because it is being used by another process.
    2>------ Build started: Project: QuizJeFit, Configuration: Debug Any CPU ------
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 2 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 3 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 4 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 5 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 6 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 7 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 8 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): warning MSB3026: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Beginning retry 10 in 1000ms. The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): error MSB3027: Could not copy "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". Exceeded retry count of 10. Failed.
    2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(3813,5): error MSB3021: Unable to copy file "obj\Debug\QuizJeFit.dll" to "bin\Debug\QuizJeFit.dll". The process cannot access the file 'bin\Debug\QuizJeFit.dll' because it is being used by another process.
    ========== Build: 0 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========
    
  • MatthewS_JCAMatthewS_JCA CAMember ✭✭

    I am also seeing this under VS2015 14.0.25431.01 Update 3, Xamarin 4.5.0.443 and Xamarin.Android 7.3.0.13

    Droid (forms) starting project
    Shared project for most of the code
    Portable project (called Parameters) that seems to be having the issue

    Severity Code Description Project File Line Source Suppression State
    Error Unable to copy file "obj\Debug\Parameters.dll" to "bin\Debug\Parameters.dll". The process cannot access the file 'bin\Debug\Parameters.dll' because it is being used by another process. Parameters C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 3813 Build
    Severity Code Description Project File Line Source Suppression State
    Error Could not copy "obj\Debug\Parameters.dll" to "bin\Debug\Parameters.dll". Exceeded retry count of 10. Failed. Parameters C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 3813 Build

  • EmanuelIsidor.3816EmanuelIsidor.3816 USMember

    I am also seeing this under VS2017 version 15.2(26430.4)

    Severity Code Description Project File Line Suppression State
    Error Unable to copy file "obj\Debug\project" to "bin\Debug\project.dll". The process cannot access the file 'bin\Debug\project.dll' because it is being used by another process.

  • JosHuybrighsJosHuybrighs USMember ✭✭

    I think I found a way (keep fingers crossed) to get rid of the issue on my project. My app includes 2 PCL libraries: one called CrossPlatform, the other is the 'normal' Project PCL. Both .dll files had the 'Could not copy' problem. When I include the CrossPlatform library in the Project library with the 'Copy Local' property set to false the problem disappeared.
    If you want to do this in your own project: select the included PCL in the 'reference' section; 'Copy Local' can be found in the Properties window.
    Not sure what this means (don't have the time to look it up) but it so far lets me build and re-build without problems.

    Still wondering however that the issue might come up again. I will let you know when this is so.

    @JohnMiller: It might be interesting to look at the issue with a test project having 2 PCL files (where 1 of them is included in the other).

  • JulienRosenJulienRosen CAMember ✭✭✭✭

    Happening to me pretty much every build. I have to manually delete bin/obj folder from all projects being built. Not sure what other info I can provide, I don't think I am doing anything special.

  • batmacibatmaci DEMember ✭✭✭✭

    It occurs for me as well and this release is quite buggy. performance is awful. I am running same project on VS 2015 with 1 version before, It runs very fast, when I use VS 2017 with this release, my navigation between pages are very slow.
    Beside that it changed all my settings for android.

  • JosHuybrighsJosHuybrighs USMember ✭✭

    Too bad. The method with 'Copy local' is also not a solution. Have to wait for Xamarin to solve it I'm afraid.

  • leo-mckleo-mck BRMember ✭✭

    I'm having this exact same problem. Started after I installed vs2017 and new Xamarin Release. It happens on both VS 2017 and VS 2015. Guys, this type of thing cannot happen on a stable release. A lot of developers depend on this to work. Sorry for the rant but it is very frustrating...

  • JosHuybrighsJosHuybrighs USMember ✭✭
    edited May 15

    Xamarin's bugzilla entry says "importance: normal". Shouldn't this be: "high"? For me this blocks any further serious production work.

    A side note: since the new extension I don't get any meaningfull exception state information back in the Visual Studio debugger when my app crashes. Before, I could see the exception object properties, the exception message, etc.. For example: I could see that a bindable property from within Xaml was giving a parsing exception. Now: a blank local/auto view.

  • WinterCloudWinterCloud GBMember ✭✭✭

    Roll back to previous stable version fixed this for me.
    This version is too buggy for me, I have to skip this one.

  • JosHuybrighsJosHuybrighs USMember ✭✭

    @WinterCloud : How did you roll back? I seem to have read that this is not possible without tweaking the registry?

  • HalilDoganBolakHalilDoganBolak USMember ✭✭
    edited May 15

    I have the same problem as well. Most of what I read boils down to shutting down Visual Studio, cleaning out /obj and /bin files everywhere, killing each and every Visual Studio process and then re-starting again. Horrible experience. Additionally, I experience a bunch of weird errors (including "makeAppx.exe could not be run") when I try to build a UWP package (that depends on one PCL Xamarin.Forms application and uses AWS SDK and the Syncfusion components).

    @WinterCloud How do we rollback from this buggy release nightmare ? I am running VS 2015 Update 3; Xamarin Stable release 15.2

    @JohnMiller Please mark this bug as urgent or high priority or something similar - this is serious

  • HalilDoganBolakHalilDoganBolak USMember ✭✭

    @WinterCloud - Found your answer on another thread. Copying below for all others:

    I've never done roll back Xamarin, so if anyone interested. Here is how to.

    Download Xamarin.VS 4.4 from your Xamarin account page -> downloads -> View all versions (Under big button)

    roughly 900mb msi package, install.

    Once finished, Xamarin.Forms need to be rolled back as well. I rolled back to Xamarin.Forms 2.3.3.193.

    Problems fixed (for me at least):
    1. ListView start to working again. (Sample project attached in the thread starter. )
    2. No "Can't copy [PortableProject.dll] because can't access it (system lock)." error anymore.

  • WinterCloudWinterCloud GBMember ✭✭✭

    @JosHuybrighs @HalilDoganBolak

    Seems you found it, suffering the same issue and more. My old thread here:
    https://forums.xamarin.com/discussion/comment/273586

  • RyanWatsonRyanWatson USMember ✭✭✭

    Does anyone know if the prerelease version of 15.3 solves this problem?

  • Ralph67Ralph67 USMember ✭✭

    We have the same annoying problem here - We have to remove /bin and /obj folder before EACH build process that is simply unacceptable! Damned! Why do those Xamarin guys don't work under high pressure to build a patch for this?
    Haven't there been any tests before rolling out this "stable" release?

    We decided to switch over our mobile application development to Xamarin a few months ago - We are under concrete project pressure now ... no time to play around now. We thought, Xamarin has been grown to an adult development system meanwhile but recognizing this problem, i deeply doubt in that!

  • PatriceBoissonneaultPatriceBoissonneault CAMember ✭✭
    edited May 19

    Having this problem as well, very annoying ! Decided to rollback to 4.4. Thanks for the suggestion.

  • MC85MC85 USMember

    Same problem here with both our VS2015 and VS2017 dev machines, both running Xamarin 4.5 latest stable release as of today. Prior versions (4.4 etc) do not exhibit the issue. The workaround for me at the moment is to, after each change, run Build/Clean and then Full Rebuild prior to Deploy/Run to a device or emulator - this seems to clear it. In addition clearing /bin and /obj folders is also an option but too time consuming.

    At this stage, rather than hacking .csproj files for workarounds, or writing a script to clean between builds, I think I'll downgrade to the previous version. Like others we have live apps which need P1 support - no time to mess about firefighting the environment every time we do an upgrade. It should just work.

    Yet another "stable" release!

  • batmacibatmaci DEMember ✭✭✭✭

    I have downloaded 4.6 version on VS2017 and Problem persist there. why did you make a new release without fixing this problem? I cant understand this. Currently i am using 4.4 version on VS2015 and it works fine and 4.6 on VS2017 preview just for Xamarin Live.

  • JasonCoutureJasonCouture USMember

    Also having this issue. Been using Xamarin for over 2 years, every other update this happens. Why can't you people test before you roll out?

  • ArthurKaterArthurKater TWMember ✭✭

    Had this problem before. Lost quite a bit of time during development due to restarting VS between builds.
    Finally it got solved.

    And now we have the same bug again.... FRUSTRATING!

  • RaphaelSchindlerRaphaelSchindler USMember ✭✭✭

    This should've been fixed with 4.5.0.475. After upgrading to that version I don't have the problem anymore

  • JasonRaiJasonRai USMember ✭✭

    Is there a way to get 4.5.0.475 on VS 2017 stable?

  • JosHuybrighsJosHuybrighs USMember ✭✭

    I am running on 4.5.0475 for the last 3 days. Since the install, the error never came up anymore!
    Keep fingers crossed!!!

  • abraabra ADMember ✭✭

    I am running VS 2017 version 15.2 (26430.6) and the "Xamarin for Visual Studio" extension does not show any available update (installed version is 4.5.0.443). Is it possible to update it manually ?

  • TolulopeAsaluTolulopeAsalu USMember ✭✭

    I'm running VS 2017 and keep getting an error. This is the error it shows.

Sign In or Register to comment.