﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » TargetParameterCountException when running the DDT via a c# application</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 13 Jun 2026 07:38:55 GMT</lastBuildDate><ttl>20</ttl><item><title>TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28892.aspx</link><description>&lt;font color=#000000&gt;Hi all,&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;We have created a custom application which&amp;nbsp;deploys a DDT package.&amp;nbsp; This has worked fine until the 1.7.3 upgrade.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;The application does implement the&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ISynchronizeInvoke &lt;font color=#000000&gt;interface.&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style="COLOR: #2b91af"&gt;&lt;font color=#000000&gt;We are seeing that OnPreDeploymentScriptExecutionStarted gets fired off through the Invoke method (actually using a&amp;nbsp;dynamicInvoke)&amp;nbsp;and then a short time later Invoke is called again with an ErrorReached method.&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style="COLOR: #2b91af"&gt;&lt;font color=#000000&gt;Below is the error:&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;TargetParameterCountException&lt;br/&gt;&amp;nbsp; Parameter count mismatch.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : mscorlib&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;Stack Trace: &lt;br/&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)&lt;br/&gt;&amp;nbsp;&amp;nbsp; at System.Delegate.DynamicInvokeImpl(Object[] args)&lt;br/&gt;&amp;nbsp;&amp;nbsp; at System.Delegate.DynamicInvoke(Object[] args)&lt;br/&gt;&amp;nbsp;&amp;nbsp; at OHR.DeployDDT.DDTDeployment.Invoke(Delegate method, Object[] args) in C:\Projects\SYSTOC.NET\MAIN\Utilities\CommandLineDDT\OHR.CommandLineDDT\DDTDeployment.cs:line 642&lt;br/&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.OnPreDeployScriptExecutionStarted(Object sender, EventArgs e)&lt;br/&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.ExecutePreProfileScripts()&lt;br/&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.EnsureDatabases()&lt;br/&gt;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployMetaDataThread()&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;span style="COLOR: #2b91af"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&lt;br/&gt;&lt;font color=#000000&gt;Any help you can give would be greatly appreciated.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000&gt;-Cory&lt;/font&gt;</description><pubDate>Mon, 10 Jan 2011 07:26:45 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost29331.aspx</link><description>At this time setting InvokeRequired to False has resolved the issue for us.&lt;br/&gt;&lt;br/&gt;Thank you for your time looking at this.&lt;br/&gt;&lt;br/&gt;-Cory</description><pubDate>Mon, 10 Jan 2011 07:26:45 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28992.aspx</link><description>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.&lt;br/&gt;&lt;br/&gt;If you can't figure this out, write a simple sample that reproduces the behavior and we will look at it.</description><pubDate>Wed, 17 Nov 2010 08:17:55 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28985.aspx</link><description>Working on it, Cory. Trying to check if changes on 1.7.3 demanded new params.</description><pubDate>Wed, 17 Nov 2010 07:01:21 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28976.aspx</link><description>here is a code snippet but really it's just from the &lt;span style="COLOR: #2b91af"&gt;ISynchronizeInvoke&lt;/span&gt;&amp;nbsp;interface implementation:&lt;br/&gt;&lt;br/&gt;&lt;pRE style="FONT-FAMILY: consolas"&gt;&lt;span style="COLOR: blue"&gt;        public&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&amp;nbsp;Invoke(&lt;span style="COLOR: #2b91af"&gt;Delegate&lt;/span&gt;&amp;nbsp;method,&amp;nbsp;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;[]&amp;nbsp;args)&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&amp;nbsp;method.DynamicInvoke(args);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;&amp;nbsp;InvokeRequired&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;get&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;&amp;nbsp;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;&lt;/PRE&gt;&lt;pRE style="FONT-FAMILY: consolas"&gt;Returning InvokeRequired as true throws the error later when Invoke is called.&lt;/PRE&gt;</description><pubDate>Tue, 16 Nov 2010 08:31:43 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28903.aspx</link><description>Hi Cory.&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;And sorry for asking, but could you post the code where you are invoking the method?</description><pubDate>Wed, 03 Nov 2010 16:30:55 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28897.aspx</link><description>Hi Ivan and thanks for the reply,&lt;br/&gt;&lt;br/&gt;No we don't call anything directly at all.&lt;br/&gt;&lt;br/&gt;It is called through the invoke method and hasn't changed in quite some time (except for the upgrade).&lt;br/&gt;&lt;br/&gt;-Cory</description><pubDate>Wed, 03 Nov 2010 07:30:31 GMT</pubDate><dc:creator>Cory Cookson</dc:creator></item><item><title>RE: TargetParameterCountException when running the DDT via a c# application</title><link>http://forum.strataframe.net/FindPost28893.aspx</link><description>Hi Cory.&lt;br/&gt;&lt;br/&gt;Isn't there any parameter being missed?</description><pubDate>Tue, 02 Nov 2010 16:37:48 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>