Imports are not automatically added to the Imports designer when WorkflowDesigner.Load (Object) is called

This article has been archived. It is offered "as is" and will no longer be updated.

In a rehosted application, the Imports designer is not refreshed after WorkflowDesigner.Load Method (Object) is called. The Object may be an activity with expressions, and the expressions may be unexpectedly invalid because there are no namespaces in the Imports designer.

Note For more information about WorkflowDesigner.Load Method (Object), see the WorkflowDesigner.Load Method (Object) topic on MSDN.



This behavior is by design. The user must explicitly set VisualBasicSettings before an object is loaded.

Note For more information about VisualBasicSettings, see the VisualBasicSettings topic on MSDN.


Before the object is loaded, set VisualBasicSettings on the root workflow activity by calling the VisualBasic.SetSettings method.

Note For more information about the VisualBasic.SetSettings method, see the VisualBasic.SetSettings method topic on MSDN.

The following code example shows the calling sequence.


            VisualBasicSettings settings = VisualBasic.GetSettings(rootActivity);     

            if (settings == null)


                settings = new VisualBasicSettings();               



            settings.ImportReferences.Add(new VisualBasicImportReference() { Import = requiredNamespace, Assembly = requiredAssemblyName });


            VisualBasic.SetSettings(rootActivity, settings);



Article ID: 2015702 - Last Review: 12/12/2015 05:57:42 - Revision: 1.0

Windows Workflow Foundation

  • kbnosurvey kbarchive KB2015702