missing method exception in CallExternalMethodActivity

Hello,

I cant figure out why i'm getting this exception. My statemachine workflow is invoking my custom activity that calls SetSecurity. Anyone?

System.Workflow.Runtime Error: 1 : Execute of Activity symyxSetSecurityActivity1 threw System.MissingMethodException: Method 'Symyx.Framework.Workflow.IWorkflowSecurity.SetSecurity' not found.

<StateInitializationActivity x:Name="InProgressInitialization" Description="In progress initialization">
<ns1Tongue TiedymyxSetSecurityActivity SecurityObjectId="{ActivityBind SymyxBasicWorkflow,Path=ObjectID}" x:Name="symyxSetSecurityActivity1" ActorPermissions="vault.user1,Right.Access.Write;vault.user2,Right.Access.Read" />
</StateInitializationActivity>

Sniplets from my workflow runtime host:

WorkflowSecurityService securityService = new WorkflowSecurityService();
workflowRuntime_.AddService(securityService);

public class WorkflowSecurityService : IWorkflowSecurity
{
public void SetSecurity(Guid workflowInstanceId, VaultId objectId, string securitySettings)
{

[1438 byte] By [Steve1999] at [2008-1-10]
# 1
This looks like assembly version mismatch issue. If you're using multiple assemblies/projects, make sure the correct version of dll is loaded when workflow is executed.
AndreiRomanenko-MSFT at 2007-10-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2
Andrei, thanks.

I'm not sure what you mean exactly. Here's my custom activity that calls SetSecurity method on IWorkflowSecurity.

public partial class SymyxSetSecurityActivity : CallExternalMethodActivity

public SymyxSetSecurityActivity()
{
base.InterfaceType = typeof(Symyx.Framework.Workflow.IWorkflowSecurity);
base.MethodName = "SetSecurity";
}

In my workflow runtime host (winservice), this method is implemented:

WorkflowSecurityService securityService = new WorkflowSecurityService();
workflowRuntime_.AddService(securityService);

Where do i look to see if there's an assembly version mismatch?

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

One of the ways would be

- Break into debugger when the exception happens.

- Check the loaded Modules (Debug/Windows/Modules menu in Visual Studio), and the paths where assemblies were loaded from.

- Check those locations have most recent assemblies.

Specifically it would be interesting to check assemblies, which define workflow, custom activity, and the IWorkflowSecurity interface.

AndreiRomanenko-MSFT at 2007-10-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4
i attached with the debugger and turned break on exception on. it didnt break on this particular exception.

i checked debug/windows/modules and see that the location where this method lives, symyx.framework.dll, is current in the bin directory of my windows service (this hosts the runtime).

using .net reflector, i see that this dll has

public void SetSecurity(Guid workflowInstanceId, VaultId objectId, string securitySettings);
Declaring Type: Symyx.Framework.Workflow.WorkflowSecurityService
Assembly: Symyx.Framework, Version=6.0.0.0
The exception that cause this thread was saying specifically that SetSecurity is missing. This has nothing to do with the custom activity (e.g., it was able to locate the custom activity and call OnMethodInvoking)?

Here's the custom activity's OnMethodInvoking:

protected override void OnMethodInvoking(System.EventArgs e)
{
this.ParameterBindings["workflowInstanceId"].Value = base.WorkflowInstanceId;
this.ParameterBindings["securitySettings"].Value = this.ActorPermissions;
this.ParameterBindings["objectId"].Value = this.SecurityObjectId;
}

There's gotta be something silly going on here....

Steve1999 at 2007-10-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5
Andrei, is there any other way to get more detail on this exception? i'm unable to catch it in the debugger (even when attached to my workflow host).

everything seems fine. this is frustrating.

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

You should be able to catch the exception in debugger. Make sure you have the following in Visual Studio:

a) Uncheck "Enable Just My Code (Managed only)" from Tools->Options->Debugging.

b) After you attach to debugee, check "Thrown" for "Common Language Runtime Exceptions" in Debug->Exceptions window.

That should help you catch the exception here.

VishalKalra-MSFT at 2007-10-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified