Bug 55743 - Error "Cannot access a disposed object" when starting profiling
Summary: Error "Cannot access a disposed object" when starting profiling
Status: RESOLVED ANSWERED
Alias: None
Product: Profiler
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Rodrigo Moya
URL:
Depends on:
Blocks:
 
Reported: 2017-04-28 18:39 UTC by Daniel Stolt
Modified: 2017-05-02 13:08 UTC (History)
3 users (show)

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

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:
Status:
RESOLVED ANSWERED

Description Daniel Stolt 2017-04-28 18:39:51 UTC
Running the profiler from Visual Studio 2017 for a Xamarin.iOS project.

Build configuration: Debug
Platform: iPhoneSimulator

Target is the "iPhone 7 iOS 10.3" simulator, and I'm selected the "Performance" instrument. I leave all other options unchanged.

The error message appears in the status bar of the profiler:
"Sorry, something went wrong trying to run Daniel: Cannot access a disposed object."

I can build and run the app in the simulator fine; only the profiling scenario does not work.

The profiler log file:

XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5468] ##########################################
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5488] # Xamarin Profiler version -  1.4.0.1
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5488] #  * Arch x86_64
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5488] ##########################################
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5839] initializing android platform
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5839] initializing ios platform
XamarinProfiler.Core.Profiler Information: 0 : [2017-04-28 20:25:12.5848] initializing mlpd platform
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:19.8479] Initializing profiling...
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:19.8940] Connecting to 10.211.55.2 as Daniel Stolt
XamarinProfiler.Windows.MainWindow Information: 0 : [2017-04-28 20:25:20.4028] StartRecording for Daniel
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:21.0308] Deploying profiler agent to 10.211.55.2
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:26.5020] Starting listener on port 56101
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:26.5118] Starting Daniel on iPhone 7 iOS 10.3 | iOS 10.3
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Error: 0 : [2017-04-28 20:25:26.9038] error occured on run Daniel error MT0069: The app directory '/Users/Daniel' does not exist.
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Error: 0 : [2017-04-28 20:25:26.9038] error occured on run Daniel error MT0069: The app directory '/Users/Daniel' does not exist.
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:26.9038] Sorry, something went wrong trying to run Daniel: error MT0069: The app directory '/Users/Daniel' does not exist.
XamarinProfiler.Windows.Core.ProfileIosXmaRun Information: 0 : [2017-04-28 20:25:26.9079] Stopping remote application
XamarinProfiler.Windows.MainWindow Error: 0 : [2017-04-28 20:25:26.9168] Error occured on run Daniel: error MT0069: The app directory '/Users/Daniel' does not exist.
XamarinProfiler.Windows.MainWindow Error: 0 : [2017-04-28 20:25:26.9168] Error occured on run Daniel: error MT0069: The app directory '/Users/Daniel' does not exist.
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Error: 0 : [2017-04-28 20:25:26.9178] error occured on run Daniel Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Error: 0 : [2017-04-28 20:25:26.9178] error occured on run Daniel Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
XamarinProfiler.Windows.ViewModels.ProgressReport.ReportViewModel Information: 0 : [2017-04-28 20:25:26.9178] Sorry, something went wrong trying to run Daniel: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
XamarinProfiler.Windows.Core.ProfileIosXmaRun Information: 0 : [2017-04-28 20:25:26.9178] Stopping remote application
Comment 1 Rodrigo Moya 2017-05-02 11:14:31 UTC
Ok, the problem seems to be on the Mac machine, which can't find the user's home. When connecting to the Mac from VS, please use your user's ID (you can find it by running "who am i" or "id" on a terminal on the Mac), not your user's full name, which contains spaces in most cases ("Daniel Stolt").

So, please try reconnecting to the Mac agent from VS using that, and let me know if it works any better for you.
Comment 2 Daniel Stolt 2017-05-02 13:08:26 UTC
That did the trick, thank you!