During the upgrade of our winforms application from 10.2.5 to 100.2 the starting of the local map service (working with a MPK file) would regularly fail within Visual Studio after working for a couple of hours with no issues. The Esri.ArcGISRuntime.LocalServices.LocalMapService StartAsync call would return 'A task was cancelled'.
I can force the same behaviour on our test environment by opening map windows within multiple copies of our application at the same time. There is plenty of free memory available when this happens. The stack trace is:
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ...SpatialMapControl.VB$StateMachine_128_LoadAsync.MoveNext() in ..\SpatialMapControl.xaml.vb:line 418
If possible it would be good to get an understanding of why this might happen so that we can try to reduce the likelihood of this occurring in a production environment.
Increasing the memory on machine I had thought cured this occurring within Visual Studio but it has just recurred. I've restarted Visual Studio, cleared out any ArcGISRuntime folders within C:\Users\robert.haines\AppData\Local\Temp\ and even restarted my machine and it is still occurring.
It also fails every time on my line manager machine in this manner.
It would be useful to see the code you're using to start/stop the local service, although I suspect that's not the cause in this case.
Are you able to share you map package file? We can try to repro. There's a 10MB limit on Geonet, assuming it's larger than that you can email email@example.com with download details or to request a location to upload the mpk.