Hello,
I have created a workflow (XAML), compiled it and now like to run it. For that I am loading compiled DLLs in a AppDomain somthing like this
private IDictionary<string, object> LoadWorkflowAssemblyInSeperateAppDomainExecuteAndUnload(string workflowLocation, Dictionary<string, object> inputParameters, string prefix, string workflowName)
{
string assemblyFullPath = GetAssemblyPath(workflowLocation, prefix, workflowName);
var evidence = new Evidence(AppDomain.CurrentDomain.Evidence);
string temp = CommonFunctions.GetFolderName(assemblyFullPath);
AppDomain subDomain = AppDomain.CreateDomain("WorkflowExecutionDomain", evidence, temp, Path.GetFullPath(assemblyFullPath), true);
string assmeblyFullName = AssemblyName.GetAssemblyName(assemblyFullPath).FullName;
object workflowClass = subDomain.CreateInstanceAndUnwrap(assmeblyFullName, workflowName);
var workflowExecutionResponse = WorkflowInvoker.Invoke(workflowClass as Activity, inputParameters);
AppDomain.Unload(subDomain);
return workflowExecutionResponse;
}
But while loading this gives me error that workflowclass which I am trying to load is not marked as serializable.
How can I mark it Serializable? Is there any attribute which I can add in XAML to make this class serializable?
Please advice.
regards,
Software Engineer