Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created an WPF application by rehosting workflow designer.
I have created custom activities and created them as a dll.
If i add reference to the dll's in design time i could use the dll's custom activities.
Now the issue is i want to load the activities from the dll's which are kept in a folder.
Example: User creates an dll with custom activities and places in a folder. If the application[Main WPF Application] is opened all the activities present as dll in the folder should be loaded in the activity toolbox for using in the workflow.
Request soonest help on the above...

What I have tried:

namespace ThirdParty
{

public sealed class ThirdPartyActivity : CodeActivity
{
// Define an activity input argument of type string
public InArgument<string> Text { get; set; }

// If your activity returns a value, derive from CodeActivity<tresult> // and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
string text = context.GetValue(this.Text);

Activity act = (Activity)XamlServices.Load(this.Text.Get(context));
WorkflowInvoker.Invoke(act);
}
}
}

Have tried to create a designer with textbox and button, if the user enter the dll path and clicks the button, the functions available inside the dll should be available, but failed. Have invoked external XAML file, but need to do the same with dll.
Posted
Comments
Kenneth Haugland 25-Apr-16 11:51am    
Perhaps MEF or load the Dll with the LoadLibrary from kernel.dll?
Mohideenmeera 27-Apr-16 3:41am    
its an custom dll with activities, i would keep the dll in a folder and would like to load the rehosted workflow designer toolbox with the activities of the dll....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900