PerPersson

I have a project in my solution containing the workflow and a class library with custom activities. How should I add my custom activities to the workflow toolbox

If I select Choose Items, Activities, Browse and select the library with custom activities they are added to the toolbox and I can drag/drop them to the workflow. But if I then make changes to the activity I must delete them from the toolbox and add them again or I get an error when I drag/drop them to the workflow. So it works if I add the activities to the toolbox again but then the custom activities that was previoulsy in the workflow stops working so it seems that there must be a better way. I think that they should show up automatically but they do not. I'm using VS.NET 2005.



Re: Windows Workflow Foundation Custom Activities and Toolbox

PerPersson

The problem that the activity stopped working was an error in my custom activity. But I still have a problem that it does not automatically show up in the toolbox.





Re: Windows Workflow Foundation Custom Activities and Toolbox

Clement Leung - MSFT

You will need to do the following steps:

a.) in VS 2005, build the custom activity first to produce a dll file for it.

b.) add a reference in your workflow project to that custom activity by

1.) right clicking on references in your workflow project and click on "add references"

2.) navigate to your custom activity folder\bin\debug and add the dll file as a reference


Now when you go into your toolbox (click on view -> toolbox), the custom activity should now appear in the toolbox and you can readily drag and drop it into the workflow.






Re: Windows Workflow Foundation Custom Activities and Toolbox

PerPersson

Thanks for your answer but it is almost what I have done. Except for that both projects are in the same solution so the added reference is to the activity project instead of the DLL file.

I have read here om the forum that there is a problem if the activity project is in a solution folder. So I have also tried to move the activity project to the root of the solution but it did not help.





Re: Windows Workflow Foundation Custom Activities and Toolbox

Clement Leung - MSFT

Try cleaning both your projects, and re-building the custom activity project, see if that helps.






Re: Windows Workflow Foundation Custom Activities and Toolbox

PerPersson

Thanks for your suggestions. It worked when I did the following.

Moved the activity project to the root of the solution.
Removed the reference to the activity project from the workflow project and added it again.
Cleaned both projects
Did a Rebuild Solution