This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

During the deployment of a package while attempting to deploy a workflow, the following error is shown:

"System.Reflection.TargetInvocationException: C:\ProgramData\Temp\45238460f946415c8162209830722610\Deployment\RequestManagement.msbuild(79,5) : error : Notification Service: Task Error: Index was outside the bounds of the array."

Image

Symptoms

The package will fail to deploy with the above error and the following error will also be present in the Deployment Logs:

"C:\ProgramData\Temp\820f18ea83214e9093053b87118fb4ea\Deployment\K2.CMN.WKF.EmailGeneration.msbuild(79,5) : error : Notification Service: Task Error: Index was outside the bounds of the array. C:\ProgramData\Temp\820f18ea83214e9093053b87118fb4ea\Deployment\K2.CMN.WKF.EmailGeneration.msbuild(79,5) : error MSB4018: The 'SourceCode.DeploymentTasks.NotificationService.NotificationTask' task failed unexpectedly. System.IndexOutOfRangeException: Index was outside the bounds of the array. at SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder.ParseConnectionString(String connectionString) at SourceCode.DeploymentTasks.NotificationService.Common.Publish() at SourceCode.DeploymentTasks.NotificationService.NotificationTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() InnerException: C:\ProgramData\Temp\820f18ea83214e9093053b87118fb4ea\Deployment\K2.CMN.WKF.EmailGeneration.msbuild(79,5) : error : Notification Service: Task Error: Index was outside the bounds of the array."

Troubleshooting Steps

Make sure that you are on the latest Cumulative Update, you can download the CU from the K2 Portal Site.

If the latest CU does not solve the issue, make sure that the SmartObject Server is set to default here:

Pre K2 Blackpearl 4.7:

Workspace > Management Console > [K2 Server] > Environment Library > [Default Environment] > Field Management

K2 Blackpearl 4.7 and K2 Five:

K2 Management > Environment Library > [Default Environment]

Search and Edit SmartObject Server