Could not copy "obj\Debug\netstandard2.0\MyApp.dll" to "bin\Debug\netstandard2.0\MyApp.dll"

MikilllMikilll Member ✭✭✭

Hello. Frequently in Xamarin I receive the following error:

Could not copy "obj\Debug\netstandard2.0\MyApp.dll" to "bin\Debug\netstandard2.0\MyApp.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\netstandard2.0\MyApp.dll' because it is being used by another process. The file is locked by: "Microsoft Visual Studio 2017 (14740)"    MyApp   C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets

I have not found any effective solution to this problem. Restarting VS or cleaning and rebuilding solution theoretically solves this problem but it is time consuming. I'm looking for a real solution to this problem.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    What's the version of your Visual Studio? Try to update your VS to the latest version.
    And removing obj/bin folder, cleaning, rebuilding the project is a useful method to fix this kind of issue. It's not difficult to do that and this issue won't occur very frequently.

  • MikilllMikilll Member ✭✭✭

    I have VS 15.8.8. This error occurs very frequently. Cleaning and rebuilding take too long so I want to get to know the true reason why this error happens.

Sign In or Register to comment.