I have a script task which when I try to execute I get the following popup error messagebox (I cannot even debug the task, no breakpoints are reached even if its the first line):
DTS Script task has encountered an exception in user code
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& 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()
Now - heres the thing. I have copied the code from inside the script task and transferred it over to a C# windows form project, so the code gets executed when a button gets clicked. It works fine! Why is the exact same code not getting executed in SSIS?
I have hardcoded all the variables in the script task for now, I am not passing in any variables.