TargetParameterCountException when running the DDT via a c# application


Author
Message
Cory Cookson
Cory Cookson
StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)
Group: Forum Members
Posts: 30, Visits: 416
Hi all,

We have created a custom application which deploys a DDT package.  This has worked fine until the 1.7.3 upgrade.

The application does implement the ISynchronizeInvoke interface.

We are seeing that OnPreDeploymentScriptExecutionStarted gets fired off through the Invoke method (actually using a dynamicInvoke) and then a short time later Invoke is called again with an ErrorReached method.

Below is the error:

TargetParameterCountException
  Parameter count mismatch.


Source     : mscorlib

Stack Trace:
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at OHR.DeployDDT.DDTDeployment.Invoke(Delegate method, Object[] args) in C:\Projects\SYSTOC.NET\MAIN\Utilities\CommandLineDDT\OHR.CommandLineDDT\DDTDeployment.cs:line 642
   at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.OnPreDeployScriptExecutionStarted(Object sender, EventArgs e)
   at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.ExecutePreProfileScripts()
   at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.EnsureDatabases()
   at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployMetaDataThread()



Any help you can give would be greatly appreciated.

-Cory

Cory Cookson

Software Developer

Occupational Health Research

Tags
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Cory.

Isn't there any parameter being missed?
Cory Cookson
Cory Cookson
StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)
Group: Forum Members
Posts: 30, Visits: 416
Hi Ivan and thanks for the reply,

No we don't call anything directly at all.

It is called through the invoke method and hasn't changed in quite some time (except for the upgrade).

-Cory

Cory Cookson

Software Developer

Occupational Health Research

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Cory.

Version 1.7.3 has introduced some new porperties and events. Some are the SkipPreDeploymentScripts and SkipPostDeploymentScripts, which allows the pre and post scripts to be excluded from execution. Just for testing purposes, have you tried setting these properties to avoid the execution during deployment? Maybe there could be something there.

And sorry for asking, but could you post the code where you are invoking the method?
Cory Cookson
Cory Cookson
StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)
Group: Forum Members
Posts: 30, Visits: 416
here is a code snippet but really it's just from the ISynchronizeInvoke interface implementation:

        public object Invoke(Delegate method, object[] args)
        {
            return method.DynamicInvoke(args);
        }

        public bool InvokeRequired
        {
            get { return true; }
        }
Returning InvokeRequired as true throws the error later when Invoke is called.


Cory Cookson

Software Developer

Occupational Health Research

Edited 14 Years Ago by Cory Cookson
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Working on it, Cory. Trying to check if changes on 1.7.3 demanded new params.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Cory, there were events that get raised, but they use the ISynchronizeInvoke to see if an invocation needs to take place. Are you passing over a SyncObject on the constructor of the DatabaseMigrator? That is why I asked for your code, since looking at it we would be less confused if you weren't using a sync object, as there wouldn't be a test determining whether the _SyncObj is null. But since you say it has been working, there is mostly likely a test elsewhere.

If you can't figure this out, write a simple sample that reproduces the behavior and we will look at it.
Cory Cookson
Cory Cookson
StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)StrataFrame Novice (86 reputation)
Group: Forum Members
Posts: 30, Visits: 416
At this time setting InvokeRequired to False has resolved the issue for us.

Thank you for your time looking at this.

-Cory

Cory Cookson

Software Developer

Occupational Health Research

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search