Bug 49615 - building or cleaning with VS2015 up3 throws a cannot access a disposed object error (reoccurring or diff from Bug 44570)
Summary: building or cleaning with VS2015 up3 throws a cannot access a disposed object...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms ()
Version: 4.2.0 (C8)
Hardware: PC Windows
: Normal normal
Target Milestone: 4.3.1 (C9SR1)
Assignee: Bugzilla
Depends on:
Reported: 2016-12-11 16:09 UTC by Lyndon Hughey
Modified: 2017-05-02 20:32 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Xamarin Logs from PC (5.78 KB, application/x-zip-compressed)
2016-12-20 23:32 UTC, Lyndon Hughey
Xamarin Logs from Mac (3.05 MB, application/x-zip-compressed)
2016-12-20 23:33 UTC, Lyndon Hughey
Diagnostic MSBuild output from PC (7.27 MB, text/plain)
2016-12-20 23:35 UTC, Lyndon Hughey
Diagnostic Clean output from PC (471.99 KB, text/plain)
2016-12-20 23:36 UTC, Lyndon Hughey

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Lyndon Hughey 2016-12-11 16:09:13 UTC
I'm receiving the following error using VS2015 up3 when trying to build, rebuild or clean my XF PCL project.  I see that bug 44570 has similar symptoms and was resolved in an earlier build.  

Severity	Code	Description	Project	File	Line	Suppression State
Error		The "RemoveDir" task failed unexpectedly.
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'BuildClient'.
   at Xamarin.VisualStudio.Build.BuildClient.CheckDisposed() in C:\data\lanes\3513\872717c9\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 257
   at Xamarin.VisualStudio.Build.BuildClient.DeleteDirectoryAsync(String path) in C:\data\lanes\3513\872717c9\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 179
   at Microsoft.Build.Tasks.RemoveDir.Execute() in C:\data\lanes\3513\872717c9\source\xamarinvs\src\MSBuild\Xamarin.MacDev.Tasks\MsBuildTasks\RemoveDir.cs:line 18
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	BudgetPOC.iOS		

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Xamarin (872717c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Jose Gallardo 2016-12-20 16:58:41 UTC
Hi Lyndon,

The bug you are mentioning was fixed some time ago, but this might be related.

Can you please add the following information, right after hitting the issue?

1. Xamarin Logs
Go to the menu "Help - Xamarin - Zip Logs". Please attach that zip file to the bug report.
If you can connect to the Mac, then please run that command being connected to the Mac, that way we'll get the Mac logs as well.
If you cannot connect to the Mac, can you please zip and attach the content of the log files from the Mac located at "~/Library/Logs/Xamarin-4.3/"?.

2. Diagnostic Build Output
Go to the menu "Tools - Options" and from the left panel: "Projects And Solutions - Build And Run" and change "MSBuild Output Verbosity" to "Diagnostic", and then build / clean the solution. Copy the Build Output from the Output window and share it (maybe in a gist or as a zip file).

With that information we should be able to investigate this issue.
I'm setting the Target Milestone to C9SR1 so it's under our radar and we can take a look soon after we get the details.

Comment 2 Lyndon Hughey 2016-12-20 22:28:42 UTC
Thanks Jose.  It hasn't happened in the last 24 hours or so since i updated to the latest version, but I will update this thread with the requested information if/when it does occur.
Comment 3 Lyndon Hughey 2016-12-20 23:32:27 UTC
Created attachment 18951 [details]
Xamarin Logs from PC
Comment 4 Lyndon Hughey 2016-12-20 23:33:12 UTC
Created attachment 18952 [details]
Xamarin Logs from Mac
Comment 5 Lyndon Hughey 2016-12-20 23:35:33 UTC
Created attachment 18953 [details]
Diagnostic MSBuild output from PC
Comment 6 Lyndon Hughey 2016-12-20 23:36:15 UTC
Created attachment 18954 [details]
Diagnostic Clean output from PC
Comment 7 Lyndon Hughey 2016-12-20 23:41:03 UTC
I've attached the requested files.  

Please let me know if there is anything additional I can provide you with.  Thanks again.
Comment 8 Jose Gallardo 2016-12-21 00:16:12 UTC
Hi Lyndon,

I'm changing the Status back to NEW as the information has been provided.
We'll investigate and keep you updated with the progress.

Thanks again
Comment 9 Adrian Alonso 2016-12-30 17:45:01 UTC
Hi Lyndon, I just took a look at the logs and it seems they're comming from a successful build. Did you tackle the issue again in the last few days? Please let us know if we should continue investigating the issue or if we could mark the bug as resolved. Thanks, Adrian
Comment 10 Lyndon Hughey 2016-12-30 18:04:34 UTC
Hello Adrian. The issue is not resolved. I ran into the issue just yesterday. the reason the output is showing as successful is because the build did succeed after changing the build output to diagnostic.  I followed the steps outlined verbatim in your request. The build initially failed, then I performed step #1. Then I changed the build output to diagnostic in step #2. When I rebuilt the project to get the diagnostic output, the build succeeded. 

As previously mentioned, I ran into the issue once yesterday. If needed, I'll keep my output on diagnostics so I can catch all of the information you may need to diagnosis it (if you don't currently have everything you need now). 

Please excuse any grammar errors. This was typed on a phone
Comment 11 Lyndon Hughey 2017-05-02 20:32:37 UTC
This issue has been resolved for the last few months.