ArcGIS Pro 2.6 API Reference Guide
ImportTaskAsync Method

ArcGIS.Desktop.TaskAssistant Namespace > TaskAssistantModule Class : ImportTaskAsync Method
Full path to an .esriTasks file.
Imports an ArcGIS Pro .esriTasks file. The file is added to the current project.
Syntax
public static Task<Guid> ImportTaskAsync( 
   string taskFile
)
Public Shared Function ImportTaskAsync( _
   ByVal taskFile As String _
) As Task(Of Guid)

Parameters

taskFile
Full path to an .esriTasks file.

Return Value

A Task returning the unique identifier of the task file imported. Use this unique identifier as parameters to other API calls such as ExportTaskAsync.
Exceptions
ExceptionDescription
Error importing the task file. For example the taskFile is invalid or the Tasks pane is in Designer mode and editing another task item.
This must be called on the UI thread.
Remarks
If the Tasks pane is open and in Designer mode; then an OpenTaskException will be thrown. Task files can only be imported if the Tasks pane is not in Designer mode. If the task file already exists in the project it will be updated to the file being imported. If the task file already exists in the project and is open in the Task pane, then it will be closed before being updated.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

TaskAssistantModule Class
TaskAssistantModule Members