我们可以在ssis中的脚本任务中添加自定义项目dll吗?

时间:2011-12-10 04:41:10

标签: asp.net visual-studio-2010 ssis

我正在ssis 2008中创建一个集成服务项目,并尝试将我的自定义项目dll添加到脚本任务引用并执行包,我遇到异常说

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=--------' or one of its dependencies. The system cannot find the file specified.
File name: 'Example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=-------'
   at ST_-------------.csproj.ScriptMain.Main()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [---\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [---\Software\Microsoft\Fusion!EnableLog].

   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle 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()

1 个答案:

答案 0 :(得分:2)

您的问题的简短回答是“是”。

但是,在执行包之前,需要在GAC 中将自定义DLL安装到.NET Framework文件夹中。 (验证需要.NET Framework副本,执行时需要GAC副本。是的,这很烦人。)