TaskScheduler.UnobservedTaskException
SlutförtGO/Mobile is throwing a weird message after running a simple workflow that changes the attributes of a feature and updates them using ArcGIS Enterprise/Server. I don't think it has anything to do with my workflow as the workflow completes fully before the message appears, when I started building the app in VertiGIS Studio Mobile, I used the mobile default template.
Warn 02/07/2025 14:51:13 TaskScheduler.UnobservedTaskException:
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.ArcGISExtensions.Mapping.FeatureLayerExtension.DoGetAttributes(Feature feature)
at VertiGIS.ArcGISExtensions.Data.FeatureSourceBase.GetAttributes(Feature feature)
at VertiGIS.ArcGISExtensions.Data.FeatureAttributeCollection.Fetch()
at VertiGIS.Mobile.Modules.Results.ResultsComponent.RefreshAsync(IEnumerable`1 features)
at VertiGIS.Mobile.Modules.Results.ResultsComponent.<>c__DisplayClass48_0.<<FeatureUpdatedAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass4_0.<<RunOnMainThreadAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Modules.Results.ResultsComponent.FeatureUpdatedAsync(Feature feature)
--- End of inner exception stack trace ---
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.ArcGISExtensions.Mapping.FeatureLayerExtension.DoGetAttributes(Feature feature)
at VertiGIS.ArcGISExtensions.Data.FeatureSourceBase.GetAttributes(Feature feature)
at VertiGIS.ArcGISExtensions.Data.FeatureAttributeCollection.Fetch()
at VertiGIS.Mobile.Modules.Results.ResultsComponent.RefreshAsync(IEnumerable`1 features)
at VertiGIS.Mobile.Modules.Results.ResultsComponent.<>c__DisplayClass48_0.<<FeatureUpdatedAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass4_0.<<RunOnMainThreadAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Modules.Results.ResultsComponent.FeatureUpdatedAsync(Feature feature)
--- End of inner exception stack trace ---
-
Officiell kommentar
For folks who might be running across this, we ended up opening a Support ticket with Bryan to work through this issue.
“Object reference not set to an instance of an object.” is unfortunately one of the catch-all errors that means “something, somewhere was unexpectedly empty”. So, it needs further investigaiton when it bubbles up.
-
Malcolm Walker Hi, Any update regarding this? I got the following error message:
Warn 05/19/2025 15:56:02 TaskScheduler.UnobservedTaskException:
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Value cannot be null. (Parameter 'results'))
---> System.ArgumentNullException: Value cannot be null. (Parameter 'results')
at VertiGIS.Mobile.Modules.Results.ResultsComponent.<RegisterOperations>b__51_0(MapExtensionFeatureResultArgs results, MessageExecutionContext messageExOpts)
at VertiGIS.Mobile.Toolkit.Threading.ResultAwaiter`1.GetResult()
at VertiGIS.Mobile.Modules.Workflow.Activities.RunCommand.<>c__DisplayClass7_0.<<ExecuteNamedCommandAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass4_0.<<RunOnMainThreadAsync>b__0>d.MoveNext()
--- End of inner exception stack trace ---
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Value cannot be null. (Parameter 'results'))
---> System.ArgumentNullException: Value cannot be null. (Parameter 'results')
at VertiGIS.Mobile.Modules.Results.ResultsComponent.<RegisterOperations>b__51_0(MapExtensionFeatureResultArgs results, MessageExecutionContext messageExOpts)
at VertiGIS.Mobile.Toolkit.Threading.ResultAwaiter`1.GetResult()
at VertiGIS.Mobile.Modules.Workflow.Activities.RunCommand.<>c__DisplayClass7_0.<<ExecuteNamedCommandAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass4_0.<<RunOnMainThreadAsync>b__0>d.MoveNext()
--- End of inner exception stack trace ---0 -
Hi Andreas Broothaerts, the error you're seeing is a generic error and may happen for a number of reasons. It's highly possible that it isn't the same issue that Bryan was running into. Can you please walk us through what you did to get this error so we can troubleshoot from there?
0 -
any update?
Because in VS Mobile 5.34.2
I also get this kind of error when using &Query.results in a swow results tool..
VertiGIS.Workflow.Runtime.Execution.Exceptions.ActivityExecutionException: [WF: Activity execution error] Failed to execute activity 490 with action gcx:wf:arcgis::SelectFeatures: [WF: Activity input error] Input features was invalid. Expected type array
---> VertiGIS.Workflow.Runtime.ActivityInputException: [WF: Activity input error] Input features was invalid. Expected type array
at VertiGIS.Workflow.Runtime.Utils.ActivityInputUtils.ToEnumerableOrThrow[T](IDictionary`2 inputs, String inputName, Boolean attemptConvert)
at VertiGIS.Mobile.Modules.Workflow.Activities.ShowResults.GetFeaturesFromArgsAsync(IDictionary`2 inputs)
at VertiGIS.Mobile.Modules.Workflow.Activities.ShowResults.Execute(IDictionary`2 inputs, IActivityContext context)
at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)
--- End of inner exception stack trace ---
at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)
at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteFinish(IActivityHandler handler, IDictionary`2 inputs)
at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteStart()
at VertiGIS.Workflow.Runtime.Execution.AmbientState.ExecuteCurrentContext()
at VertiGIS.Workflow.Runtime.Execution.AmbientState.Execute()
at VertiGIS.Workflow.Runtime.Execution.Engine.Run(Program program, RunOptions options)
at VertiGIS.Mobile.Modules.Workflow.WorkflowRunner.<>c__DisplayClass21_0.<<RunClientWorkflowAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at VertiGIS.Mobile.Modules.Workflow.WorkflowRunner.RunClientWorkflowAsync(Program program, RunOptions options, IActivityContext context, String uiName)
at VertiGIS.Mobile.Modules.Workflow.WorkflowRunner.RunWorkflowAsync(WorkflowProgramInfo workflowProgramInfo, RunOptions options, String uiName, IActivityContext context)
at VertiGIS.Mobile.Modules.Workflow.WorkflowService.RunWorkflowWithRetryAsync(IWorkflowRunner workflowRunner, WorkflowProgramInfo programInfo, WorkflowServiceItem item, RunOptions options, IActivityContext context, Boolean retry)
at VertiGIS.Mobile.Modules.Workflow.WorkflowService.RunWorkflowAsync(WorkflowArgs workflowArgs, MessageExecutionContext executionContext, WorkflowServiceItem item)0 -
What if you use .features in stead of .results? And is the number of returned features greater than 0?
0 -
when using .features it works.
But then the attributes are not showed up in the result list..
Yes the number is greater then 0.. Its a simple 1=1 where clause0 -
Niels Willemot you're using the `Show Results` activity without supplying the `Map Service Id` parameter which is necessary to display the attributes. You'll need to fill in the layer ID as it shows up in the app.json and that should solve this issue. If you're still running into trouble or don't know how to find that layer ID, please let me know and I'll be happy to elaborate. Also please start a new post in the future as the two errors are unrelated.
0 -
Indeed, filling in the map service ID was the trick. Thanks
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
8 kommentarer