Skip to main content

I have a process that used to build properly. Then I made a bunch of changes to it.. Now it won't compile.. Getting the following errors.


Error 1 The best overloaded method match for 'System.Xml.XmlConvert.ToString(bool)' has some invalid arguments c:WindowsMicrosoft.NETFrameworkv4.0.30319Workflow.Targets 121 6 BCDR


Error 2 Argument '1': cannot convert from 'string' to 'bool' c:WindowsMicrosoft.NETFrameworkv4.0.30319Workflow.Targets 121 6 BCDR


How do I find the place where I have a wrong configuration/cast?


-Doug

Well, here is what I did...



  1. I made a copy of the kprx file.
  2. I started a series of deletions and deployments. I would delete 2 or 3 activities, and try to deploy. The error would come up very early in the compling process, so I'd continue with a deleting a couple more activities.. Until I found the point where it would compile without error.

The above errors occurred when I tried to clear a repeating XML element using an empty string function.


Hi


 


Alternate method to verify the exact error point is to use the K2 Process View flow option available in K2 Workspace. You can get the view flow of your workflow by using the process id. To retrieve the process id, go to Process Instance option the workspace and copy the instance name along with the check box in the beginning and paste it to a notepad.


From the error message, it looks like a problem when converting some value to a Boolean.  Probably a null or empty string.  So I'd start with a review of all the places you convert a value to a Boolean.

If you're willing to dig into the kprx, open it as an xml file in Visual Studio, or your favorite XML editor, and search for all instances of the text which matches the function call.  In this case "ToString" in the first error message.  For each instance, follow the XML and try to determine the name of the activity and event in which it is located.  Back in K2 Studio, examine the details of the associated event.  I would avoid directly editing the kprx.


Reply