We are trying to use MSBuild to publish a K2 package. We currently have 4.6 installed. The deployment path for the Infopath form uses an environment variable. I've verified permissions on SharePoint site and ran Infopath form through design checker and no errors appeared. If I run MSBuild with verbose logging this is error message we get:
**** InfoPath Form Template:
NewUserRequest ****
Successfully opened the form template.
d:K2WSPFilesXXXXDeploymentXXXX.msbuild(98,5): error :
Server was unable to process
request. ---> Object reference not set to an instan
ce of an object.
Stack Trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(Soap
ClientMessage message,
WebResponse response, Stream responseStream, Boolean asyn
cCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String met
hodName, Object<] parameters)
at SourceCode.SharePoint.WebServices.K2SPFormsServices.GetRootWebUrl()
at SourceCode.Workflow.Design.InfoPath.SPHelper.GetRootSiteUrl(Boolean us
eDeploymentSiteUrl)
at SourceCode.DeploymentTasks.InfoPath.PublishFormTemplateTask.DeployForm
Template(FormTemplateObject
ftObj)
at SourceCode.DeploymentTasks.InfoPath.PublishFormTemplateTask.Execute()
Done executing task
"SourceCode.DeploymentTasks.InfoPath.PublishFormTemplateTa
sk" -- FAILED.
Done building target
"InfoPath Process and Event Deployment" in project "XXXX.msbuild" --
FAILED.
Done building project
"XXXX.msbuild" -- FAILED.
I can successfully deploy package to staging environment where it was built. We are trying to move this to our production SharePoint environment with different url and site collection but this should be handled with the environment variable on publish event. Any ideas what else I can check ? I suspected a reference is not getting replaced in build process but not sure how I can check or verify this error.