How to debug CodeActivity SharePoint 2013?

- see update below ...

  • I created an activity in a separate project of a workflow activity
  • In my SharePoint project, I added a link to the event project
  • I also included the output of the project of activities in the SharePoint package (deployment to the GAC).
  • Next in my SharePoint project, I created a pre-deployment msbuild activity to copy the DLL of my activity to the workflow manager directories (activities and WFWebRoot \ bin).
  • Of course, I also added "AllowedTypes.xml" to the two corresponding directories.
  • I have not automated restarting the workflow manager backend service. I believe I only need to restart it if the .xml file has changed, right? Or does my activity.dll change anytime?

Now my problem is that I cannot debug my CodeActivity workflow . The workflow works fine and is tied to workflow.servicehost.exe. I can debug my workflow in visual studio - it hits breakpoints on any declarative workflow work. Unfortunately, any breakpoint in my custom CodeActivity is missing :(

Any idea? Obviously, SharePoint and Workflow Manager run on the same computer. I'm not sure why the deployment of the activity DLL to the GAC is required - and the iisreset ?! (See article technical article )

UPDATE: some lessons learned ...

  • Stop the WorkflowServiceBackend before deploying (I'm using a build event).
  • Run WorkflowServiceBackend again on post-deployment event.
    Otherwise, the workflow service may block access to the GAC actions assembly and will not be replaced. It happened to me. Now that you (should) know that any GAC assembly is always preferred over any "local" assembly. And obviously the workflow service was using my GAC assembly - do I still need to copy the assembly of my actions to artifcats and wfwebroot \ bin? NO. ... I removed my DLLs from the workflow manager directories and I could still execute and debug my workflows without any problem.
+3


source to share





All Articles