TargetParameterCountException when running the DDT via a c#...

Author Message
 Posted 11/2/2010 9:56:07 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 1/10/2011 1:25:00 AM
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:

DDT
Post #28892
Add to Twitter Add to Facebook
 Posted 11/2/2010 10:37:48 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Hi Cory.

Isn't there any parameter being missed?
Post #28893
Add to Twitter Add to Facebook
 Posted 11/3/2010 1:30:31 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 1/10/2011 1:25:00 AM
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

Post #28897
Add to Twitter Add to Facebook
 Posted 11/3/2010 10:30:55 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
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?
Post #28903
Add to Twitter Add to Facebook
 Posted 11/16/2010 2:31:43 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 1/10/2011 1:25:00 AM
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: 11/16/2010 2:32:49 AM by Cory Cookson

Post #28976
Add to Twitter Add to Facebook
 Posted 11/17/2010 1:01:21 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Working on it, Cory. Trying to check if changes on 1.7.3 demanded new params.
Post #28985
Add to Twitter Add to Facebook
 Posted 11/17/2010 2:17:55 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
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.
Post #28992
Add to Twitter Add to Facebook
 Posted 1/10/2011 1:26:45 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 1/10/2011 1:25:00 AM
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

Post #29331
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.