RuleConditionDialog and intellisense

Hello,
in my custom designer I can insert/edit condition rules througth RuleConditionDialog. In order to see the dropped activities I set the TypeProvider with all referenced assemblies and the code compile unit of the current workflow (code beside).

Unfortunately I don't see the current workflow components (typing "this.myWorkflow1.") even if the code compile unit contains all activities (fields) declarations.

How can I solve the problem ?

Thanks,
Pierre

[508 byte] By [pierreg] at [2007-12-21]
# 1

Pierre,

There was a similar issue with code separated workflows (XOML) and the workaround was to some how cause an application idle event to fire, which causes the refresh to happen and then the components will show up correctly.

One action that I know causes this event to fire is to open the rule condition editor, set some valid rule and click OK button to dismiss the dialog. Next time you re-open the dialog the components will show up correctly.

Thanks,

Chethan

Chethan at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2

Hello Chethan,
unfortunately it doesn't work. How can I help in giving more info for the investigation (I cannot share the whole project)

Thanks,
Pierre

pierreg at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3

Try reproducing the error on a smaller project so that you can easily discuss it with others on the forum. Ideally start with our MSDN Library article sample and reproduce the error on that. The MSDN Library designer sample is here:

http://msdn.microsoft.com/library/en-us/dnlong/html/WFDsgnRehst.asp

Regards,
Paul

PaulAndrew at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4

Hello Paul,
ok, I create a simple activity library with a basic activity:

namespace MyActivityLib
{
public partial class EchoActivity : System.Workflow.ComponentModel.Activity
{
public EchoActivity()
{
InitializeComponent();
}

public static DependencyProperty MessageProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Message", typeof(string), typeof(EchoActivity));

[Description("Message to show on the console")]
[Category("Activity")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string Message
{
get
{
return ((string)(base.GetValue(EchoActivity.MessageProperty)));
}
set
{
base.SetValue(EchoActivity.MessageProperty, value);
}
}

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
MessageBox.Show("Echo: " + Message);
return ActivityExecutionStatus.Closed;
}
}
}

Since the activity lib must NOT be statically referenced to the host application (I am using the sample you referenced in the post), I put the dll into bin folder of the the host app. Then I added a new line to the ToolboxItems.txt:

MyActivityLib.EchoActivity, MyActivityLib

In the compileWorkflow method I added the following line

parameters.ReferencedAssemblies.Add("MyActivityLib.dll");

Ok. I put my activity into the designer, save and compile. Everything is ok. I then add an IfElseActivity and set a simple condition:

System.Environment.Username="test"

I save and close the condition box. Then I compile. I open the condition and try to write this.echoActivity1. and nothing happens. The Message property is not shown. When I force to write this.echoActivity1.Message="" I get a validation error.

Thanks,
Pierre

pierreg at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

After further investigation I probably found the problem. My application implements a plugin mechanism where the activity libraries are loaded from their own subfolder. So, if the application (designer) is on the bin folder, you will have the following file system structure:

bin
|-- Components
|-- Lib1
|- Lib1.dll
|-- Lib2
|- Lib2.dll

Investigating with fuslog I made in evidence the probing problem. So, I used (even if obsolete) AppDomain.AppendPrivatePath when I load the plug-ins but the problem seems to persists.

I cannot use other probing mechanism (ei. throught AppDomainSetup) since the libraries can be loaded when the application is already started.

Do you have any suggestion ?

Thanks,
Pierre

pierreg at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified