Hi
i get this error when i execute my SSIS package.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
the script that i use is this (it works perfectly fine when i manually set the variables [static]):
string _strFtpUserName = (string)Dts.Variables["User::FtpUserName"].Value;
string _strFtpPassword = (string)Dts.Variables["User::FtpPassword"].Value;
string _strFtpServer = (string)Dts.Variables["User::FtpServer"].Value;
string _strFtpPort = (string)Dts.Variables["User::FtpPort"].Value;
string _strFtpRemoteFolder = (string)Dts.Variables["User::RemoteFolder"].Value;
string _strLocalWorkingPath = (string)Dts.Variables["User::LocalWorkingPath"].Value;
string _strRemoteBackup = (string)Dts.Variables["User::RemoteBackup"].Value;
// asdf
string _strConfigFile = "option batch abort\r\n" +
"option confirm off\r\n" +
"open " + _strFtpUserName + ":" + _strFtpPassword + "@" + _strFtpServer + ":" + _strFtpPort + "\r\n" +
"option transfer automatic\r\n" +
"get " + _strFtpRemoteFolder + " " + _strLocalWorkingPath + "\r\n" +
"mv " + _strFtpRemoteFolder + " " + _strRemoteBackup + "\r\n" +
"close\r\n" +
"exit\r\n";
if (File.Exists("C:/Program Files (x86)/WinSCP/SSIS-SFTP-Get-Config.txt"))
{
File.Delete("C:/Program Files (x86)/WinSCP/SSIS-SFTP-Get-Config.txt");
}
StreamWriter file = new StreamWriter("C:/Program Files (x86)/WinSCP/SSIS-SFTP-Get-Config.txt");
file.WriteLine(_strConfigFile);
file.Close();
Dts.TaskResult = (int)ScriptResults.Success;
If anyone could please assist as that is all the information that the error message gives me, i have checked around on other forums and i cant seem to find a solution as it is not a right issue as i have domain admin rights.