Forum Xamarin Xamarin.iOS

Getting: Error - Cannot access a disposed object, Object name: 'BuildConnection'

Every so often, while writing Xamarin.iOS code and connected to the build agent, Visual studio will crash.
When it recovers and I re-connect to the build agent, I get an error when I try to build or debug:

Error Cannot access a disposed object.
Object name: 'BuildConnection'

The only way to get around this is to restart the PC. None of these work:
1. Restarting the Mac
2. Disconnecting and reconnecting the build agent (several times)
3. Cleaning the solution.

Logs don't show anything useful (actually shows build agent is connected), here are the last couple of lines from the spew:

Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-11-07 16:44:57.9353] MacServer State transition from SshConnectedState to AgentsStartingState on KwacksMac.local (192.168.29.124)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-11-07 16:44:58.0887] Starting agents on Mac KwacksMac.local (192.168.29.124)
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:44:58.9022] Starting Agent IDB 4.2.0.719...
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:44:59.1127] Starting Agent Build 4.2.0.719...
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:45:00.6617] Starting Agent Designer 4.2.0.719...
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:45:01.6301] Agent Build 4.2.0.719 is running
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:45:05.9657] Agent IDB 4.2.0.719 is running
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-11-07 16:45:10.3740] Agent Designer 4.2.0.719 is running
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-11-07 16:45:10.5321] MacServer State transition from AgentsStartingState to ConnectedState on KwacksMac.local (192.168.29.124)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-11-07 16:45:10.6895] Connected to the Mac KwacksMac.local (192.168.29.124) with Full support.

Sometimes waiting a while (>15 minutes) will help.

I think a good way to repro this is to be debugging on an physical device and kill visual studio. Then launch it again and try to rebuild/debug.

Any clues about this?

Answers

Sign In or Register to comment.