Select to view content in your preferred language

Async functions don't start

374
0
02-27-2019 05:41 AM
AlexShnaider
New Contributor

Async functions don't start when there are some simultaneously running .Net arcgisruntime app.

I have two .Net ARCGISRuntime 10.2.7  apps running as COM objects. The first one shows map, and uses some services. 

Second one  (called GISOperations) works only with services, and shows nothing.

They work fine when each of them running alone.  If i start the Map app, and then start GISOperations, then calling asynchronous functions from second routine, like here

QueryFilter q = new QueryFilter()
{ WhereClause = fieldName.Trim() + "=" + fieldValue.ToString(), MaximumRows = 1 };               

Task<IEnumerable<Esri.ArcGISRuntime.Data.Feature>> featuresTask = FeatTable.QueryAsync(q);
featuresTask.Wait(2000);

IEnumerable<Esri.ArcGISRuntime.Data.Feature> features = featuresTask.Result;

            or like here

var FindTask = new FindTask(uri);
Esri.ArcGISRuntime.Tasks.Query.FindResult findResult = await FindTask.ExecuteAsync(findParameters);

pausing my program (GISOperations) at last line. Execution pausing until i stop it.  Debugger shows featuresTask.Status = WaitForActivation

But when they running alone, everything works fine.  And the Map app works right even if GISOperations started before.

Help me, folks!

0 Kudos
0 Replies