繁体   English   中英

SSIS 2008:在版本化的脚本任务/脚本组件中使用自定义DLL

[英]SSIS 2008: Using Custom DLL's in Script Task/Script Components that are versioned

我有大约100个SSIS包,负责将数据从一个产品迁移到另一个产品。 这些包几乎总是包含至少一个脚本任务和/或脚本组件,它们使用.NET 3.5中构建的自定义DLL并且具有强名称。 每次我在包中引用它时,我们都要确保引用的属性“Specific Version”设置为false。 在我部署SSIS包的环境中,DLL已使用gacutil.exe进行GAC,并在SQL Server程序集缓存中转储。

我遇到的问题是我的自定义DLL的版本随着TFS的每次构建而增加。 从我所做的研究看来,参考“特定版本”属性似乎没有效果。 由于我们使用1.0.0.0开发了DLL,因此仍在寻找该版本。 我能够解决这个问题的唯一方法是在SSIS包中打开需要它的每个脚本任务,然后只需保存。 这不是一个可行的选择。 我还发现了一篇博文( http://dougbert.com/blog/post/Recompile-VSTA-scripts-programmatically-in-SSIS.aspx ),它可以让我们自动执行该操作,但需要100多个SSIS包来执行保存/更新我的所有SSIS包需要花费太多时间

注意:我也在使用C#api执行SSIS包。

我在找什么:

  • 任何允许我们继续在SSIS脚本任务/脚本组件中使用版本化DLL的解决方案
  • 如果没有SSIS 2012就解决了这个问题

以下是我得到的错误:

Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/ : 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CustomDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=119c04fbde27c5df' or one of its dependencies. The system cannot find the file specified.
File name: 'CustomDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=119c04fbde27c5df'
   at ST_240ac16d255540ce822401f59c67e591.csproj.ScriptMain.Method1()
   at ST_240ac16d255540ce822401f59c67e591.csproj.ScriptMain.Main()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\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 [HKLM\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.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature 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 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()</c

特定版本不用于此目的。 您需要在配置文件中设置绑定策略,这将允许在运行时接受一个程序集版本号代替另一个程序集版本号。 看看这个链接 - 它解释了一切比我更好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM