I just updated to Xamarin for Visual Studio 3.9.289, and now I cannot build after my debugging session ends. These subsequent builds fail with the following message:
===========================================================
The process cannot access the file 'C:\Users\Matthew Gerber\Documents\GitHub\sensus\Sensus.Android\bin\Debug\Sensus.Android.dll.mdb' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile(Guid guid)
at Pdb2Mdb.Converter.Convert(AssemblyDefinition assembly, IEnumerable`1 functions, MonoSymbolWriter mdb)
at Pdb2Mdb.Converter.Convert(String filename)
at Xamarin.Android.Tasks.ConvertDebuggingFiles.Execute()
The last access/last write time on file "bin\Debug\Sensus.Android.dll.mdb" cannot be set. The process cannot access the file 'C:\Users\Matthew Gerber\Documents\GitHub\sensus\Sensus.Android\bin\Debug\Sensus.Android.dll.mdb' because it is being used by another process.
===========================================================
I have to restart Visual Studio to get it to work.
Any ideas?

I was able to work around this by using handle.exe and removing the lock from the console.
Handle can be obtained from: https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
Then use "handle <mdb name>" to get the hex number and pid so you can then execute "handle -c <handle> -p <pid>".
So far after I do this once the lock is removed for subsequent builds.

I must say that it happened again - but when I uninstalledd app from device and configured Droid project properties to Compile:Latest API level 21, Minimum API level 15 and Target SDK version, it SEEMS its better; previously I tried probably also Compile using API level 15 (without no big reason, though); as I deploy shared runtime and used also fast deployment, may be there some clash of versions?? If it occurs again now, handle.exe help, thanks

I currently have the same problem and this is very annoying. I downgraded the Xamarin version to 3.9.236 to get Visual studio working without this bug! But this can't be the solution!
Are there any plans to fix this bug??
Thanks!

Same problem
Xamarin 3.9.547.0
Xamarin.Android 4.20.2.1
Error 2 The last access/last write time on file "bin\Debug\****.dll.mdb" cannot be set. The process cannot access the file '****\bin\Debug\****.dll.mdb' because it is being used by another process. ****
Restarting VS2012 helps

Would be very nice to get the info of who's locking the file (i.e. using sysinternals tool as mentioned above).
@Olaf: this is the first time we hear about it happening on Xamarin.iOS. Could you provide some more info on the circumstance, versions, etc.?
Thanks!

Same problem
Xamarin 3.9.547.0
Xamarin.Android 4.20.2.1
Visual Studio 12.0.31101.00 Update 4
Error 37 The last access/last write time on file "bin\Debug\*.dll.mdb" cannot be set. The process cannot access the file 'C:\Projects\*\*\bin\Debug\*.dll.mdb' because it is being used by another process. *
Restarting VS2013 helps

One thing I can add concerning Xamarin iOS is that it only seems to happen with the simulator. Rebuilding for the device seems to works fine every time (although it fails to launch the app every time :-().

I had the problem on Xamarin for Android and a I also downgraded the
Xamarin version to 3.9.236, which corrected the problem but also created new problems for me. I then decided to re-install 3.9.547.0 and I did not see the problem re-appear... that was about 7 days ago.

I have reached out to two customers and have heard the following regarding this issue: "Hi, after the last Xamarin update, seems, the problem is gone." Can I ask folks experiencing this bug to switch to the alpha channel, install the latest alpha channel build for Visual Studio [Xamarin 3.11.546.0 (8fffc2e)] and confirm if they are still experiencing the issue.
We have been unable to consistently reproduce the bug and we'd like your help to validate if we've fixed the issue or if there are additional fixes needed.

FYI yesterday I was having similar problems. After clearing the watch list, it went away. Others might want to try this to see if it helps. Perhaps when there are invalid watch list items this causes issues?

I came across this problem while debugging this piece of code:
imageView.Click += delegate
{
ImageView iv = FindViewById<ImageView>(Resource.Id.imageView1);
imageView.SetImageResource(Resource.Drawable.savebw);
};
linearLayout.AddView(imageView);
I had a Watch on iv.Height. When I removed all Watches, as philip recommended, the problem no longer persisted.

I have been able to repro and the suggested workaround is to "clear the watch list". I will investigate additional issues and possible causes, but at this time please report back if "clearing the watch list" successfully resolves the issue.

I was experiencing this bug as well, it was frustrating. I spent nearly a week trying to fix the issue. I tried downgrading and getting Alpha/Beta releases with no success. I also tried many other solutions that I had found in the Xamarin Forums. I re-installed Xamarin and that didn't work either. I then tried to reproduce the bug on a simple project, which I was unable to do. Then I just kept adding more and more of my other project in, to see at what point the bug would show itself, which it still didn't. I thought it was the project, so I re-built the Android project which was giving me problems by creating a new project and re-adding all the assets, which still had problems building/debugging. So then I tried to re-build my whole solution, re-adding my projects and re-creating my Android project. Finally I am able to build/debug without any problems. I looked over what changes had been made to the .sln file to see what could have been causing the problem and it looks like my .sln file had MANY Debug configurations declared in the file. The new file had less configurations, so I think that the configurations for the solution may have been causing the problem, but I am not sure. Either way I wanted to post this on here so that others could hopefully be able to get back to working.

I encountered this problem today on the iOS project of a xamarin.forms solution.
The file myProject/myProject.iOS/bin/iPhone/Debug/somePcl.dll was not released, so subsequent builds failed because the file couldn't be copied there.
After shutting down VS and deleting the file I was only able build one time.
A longer-lasting solution for me was to MOVE the file to a different Folder. The moved file remained unreleased, but copying to the original folder worked now, so building succeeded - and more than once.