when using Deployment with "XML Publish" file with pre-defined variables then your task runs into an error, when trying to override those variables with a new value from within the Build-Definition:
My config:
Specify XML Publish Configuration : checked
XML Config location: $(System.DefaultWorkingDirectory)/some.publish.xml
SqlCmd Variables: dbCatalogPdsCore:PDS_TST
Executing the powershell script: C:\vsoAgent\tasks\DatabaseDeployment\2.1.2\DeployDatabase.ps1
Some imported command names contain one or more of the following restricted characters: # , ( ) { } [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~
Deploying as
USER\pdsrun
Data Source=RPZMV323802;Integrated Security=True;
Configuration Specified: true
Processing Key: dbCatalogPdsCore
System.Management.Automation.MethodInvocationException: Exception calling "Add" with "2" argument(s): "An item with the same key has already been added." ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at CallSite.Target(Closure , CallSite , Object , Object , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo) at CallSite.Target(Closure , CallSite , Object , Object , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at System.Management.Automation.Interpreter.DynamicInstruction4.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Hello,
when using Deployment with "XML Publish" file with pre-defined variables then your task runs into an error, when trying to override those variables with a new value from within the Build-Definition:
My config:
Executing the powershell script: C:\vsoAgent\tasks\DatabaseDeployment\2.1.2\DeployDatabase.ps1 Some imported command names contain one or more of the following restricted characters: # , ( ) { } [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~ Deploying as
USER\pdsrun Data Source=RPZMV323802;Integrated Security=True; Configuration Specified: true Processing Key: dbCatalogPdsCore
System.Management.Automation.MethodInvocationException: Exception calling "Add" with "2" argument(s): "An item with the same key has already been added." ---> System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary
2.Insert(TKey key, TValue value, Boolean add) at CallSite.Target(Closure , CallSite , Object , Object , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo) at CallSite.Target(Closure , CallSite , Object , Object , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at System.Management.Automation.Interpreter.DynamicInstruction
4.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)