Error - (1328, 2320) - Parameter count mismatch

Recently one of the customer reported that the releases are failing with following stack trace: -

Error - (1328, 2320) - Parameter count mismatch.: \r\n\r\n at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.Dsc.DscComponentInstaller.InvokeMethodByReflection(String methodArguments)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.InstallComponentForV2PipelineImplementation(String application, String arguments, String argumentsWithStarsForPassword, Func`4 retrieveDscComponent, Func`3 dscInstallerInstance, Action`3 executeInstaller, Action writeActionLog)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.InstallComponentForV2Pipeline(String application, String arguments, String argumentsWithStarsForPassword)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.DeployComponent()

Lova Kumar Katikala from the team debugged it and made following observations: -

  • We are serializing the DSC activity parameters as a semi-colon separated string.
  • In the failing stack, we have just de-serialized the values and are trying to invoke the DSC activity with the DSC activity parameters and that part is failing with the parameter mismatch count error.
  • On debugging further, he found that this is happening because one of the parameter value (password’s value) contains semi-colon due to which the whole parameter count mismatch is happening.
  • On changing the password to the one without semi-colon things worked for the customer.

Enjoy !!