Symptoms
Error during deployment from K2 Designer - Deploying from Visual Studio or K2 Studio worked fine.
Diagnoses
I created a very basic form and workflow, but when trying to deploy from the K2 Designer it fails with the following error:
System.NullReferenceException: Object reference not set to an instance of an object.
at SourceCode.Workflow.Authoring.K2FieldPartCollection.Add(K2FieldPart item)
at SourceCode.Workflow.Authoring.K2Field..ctor(K2FieldPartr] parts)
at SourceCode.Workflow.Design.Forms.FieldParts.FormPart..ctor(ArtifactLibraryFieldPart formsServerField, String formName, Guid formId)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.ProcessSetup(DefaultProcessandamp newProcess, XmlDocument InputData, XmlDocument xmlProcess, String ProcessName, String ProjectName, String UserName)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.Generate(String LocalHostConnection, String UserName, Int32 ProcessID, String InputData, String ProcessXML, String SqlConnectionString, String HostServerConnectionString)
After investigating this, we found that the Client had custom environment template names in his environment library.
Resolution
Determine what your default Environment library template is. Custom or standard Prod/Dev (Workspace - Management Console - Workflow Server - Environment Library)
Once you've determined the default environment library template, run through the steps outlined below:
- Navigate and locate the web.cofig file in the "eInstallDir]K2 blackpearlK2 smartforms DesignerWorkflow" folder directory
- Take a backup of this file.
- Now, edit this file using notepad or any other text editing tool of your choice locate the 'andltadd key="CurrentEnvironment" value="Development" /andgt' element, and change the "value" to the name of your default Environment as determined above.
- Perform an IIS reset.
- Restart the K2 blackpearl service.