You are currently offline, waiting for your internet to reconnect

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

Symptoms

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.

 

Cause

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.

Resolution

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);

 

Properties

Article ID: 2015702 - Last Review: 04/12/2010 23:47:00 - Revision: 1.0

  • Windows Workflow Foundation
  • KB2015702
Feedback