Situation: I created a Windows Workflow Foundation (WF) application using custom Workflow activities. I compiled the project and found out that my toolbox are not showing the custom workflow activities despite re-building, re-adding the reference to the project.
This is how it looks like in my solution.
Gandalf: Thou shall not pass!
So, what really happened and what caused it? In a multi-project solution, I have the habit of adding Database Project into the solution to keep track of database changes.
I found out that it is a bug from Visual Studio where SSDT project seems to cause conflicts. But how the heck do you know that you have SSDT or not? SSDT was shipped together alongside with Visual Studio 2012, unlike Visual Studio 2010 where you have to install it externally. Therefore, to solve this issue, I boil down to 2 solutions.
Solution 1: Unloading Database Project
- Hover to the Database Project, right click and select ‘Unload Project‘.
- Then you should see that your database project shows as (unavailable).
- Rebuild the solution. View your toolbox, the workflow activity will be available.
Solution 2: Add Activities Manually
- Right Click Toolbox –> Choose Items.
- Click System.Activities Components –> Browse.
- Look for the custom workflow activity dll that you have built. Then click Open.
- The window will now show the activities available. Click OK.
- The activity should be available at the general section of the toolbox.
Arnold Schwarzenegger Workflow Activity: I AM BACK!
Have fun with workflow!
Foot notes: Should you use Solution 2, you are required to repeat the steps each time you add new activity in your project.