Sometimes, you may have to re-build the whole thing

By | September 8, 2018

 

There seem to be some kind of caching issue in v9 which I can’t exactly pinpoint, but, basically, it’s like this:

When updating a plugin assembly, you may find that either the plugins are not updated or the custom workflow activities are not update correctly. As in, you may not be able to see updated activity names in the workflow designer. Or you may not be able to see updated parameters..

For example, here is what I saw in my v9 instance:

image

While in the plugin registration tool it all looked good:

image

This was happening in v9, where the solution containing this assembly was installed as a managed solution. In the 8.2 instance, which had the unmanaged solution, everything looked good.

So I asked, I googled, but, it seems, this is just some kind of vague issue (and it’s definitely not client-side caching since I tried different browsers, private sessions, etc)

Either way, if you run into it, and if you are looking for a workaround, the only way I could make it work is by completely unregistering the plugin assembly. Which can be a bit of a challenge if you are already using those workflow activities somewhere else. Fortunately, in my case I did not have any dependencies from other managed solutions – not sure what I’d have to do if that were the case short of reinstalling all managed solutions (which would probably cost me some data).. Still, I had some other workflows relying on the workflow activities in my assembly, so, in the end, here is the workaround recipe:

 

  • Create a new solution
  • Add all the workflows using your custom activities to that solution
  • Export the solution – you’ll need to re-import it in the end
  • Deactivate all those workflows
  • Then delete them (if you don’t do it, you won’t be able to proceed to the following step)
  • Using plugin registration utility, un-register the assembly
  • Re-register your assembly, steps, and custom workflow activity (this is where, if that assembly is part of another solution, you can just re-import that solution)
  • At this point your assembly should be updated correctly
  • Finally, re-import the solution you exported above

 

This time, you should be able to see correct activity names/parameters in the workflow designer:

image

2 thoughts on “Sometimes, you may have to re-build the whole thing

  1. Jonas Wauters

    Using the Plugin Registration Tool, try pressing the floppy disk icon when you have selected the Workflow Activity. It should update the Workflow Activity accordingly without having you to do the described workaround.

    Reply
  2. Paul McQuillan

    Have not put this to the test in v9 – but in previous versions of Dynamics you could force CRM to apply the latest version of the installed DLL Logic by incrementing the Version Number in the Project Manifest.

    On registration, the Plugin Registration Tool then picks up that the DLL is a new version and clears the cache accordingly.

    Have not tried this in v9 so would be interesting to see if this works in the same way.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *