C# SSIS 2008:使用自定义DLL';已版本化的脚本任务/脚本组件中的

C# SSIS 2008:使用自定义DLL';已版本化的脚本任务/脚本组件中的,c#,dll,tfs,ssis,.net-3.5,C#,Dll,Tfs,Ssis,.net 3.5,我有大约100个SSIS包,负责将数据从一个产品迁移到另一个产品。这些包几乎总是包含至少一个脚本任务和/或脚本组件,它们使用.NET 3.5中内置的自定义DLL,并具有强名称。每次我在包中引用它时,我们都会确保引用的属性“Specific Version”设置为false。在我将SSIS包部署到的环境中,DLL已使用gacutil.exe添加,并转储到SQL Server程序集缓存中 我遇到的问题是,我的自定义DLL的版本随着TFS的每次构建而增加。从我所做的研究来看,引用“特定版本”属性似乎没

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

我遇到的问题是,我的自定义DLL的版本随着TFS的每次构建而增加。从我所做的研究来看,引用“特定版本”属性似乎没有效果。由于我们使用DLL的1.0.0.0进行开发,它仍在寻找该版本。我能够解决这个问题的唯一方法是在SSIS包中打开每个需要它的脚本任务,然后简单地保存。这不是一个可行的选择。我还发现了一篇博客文章(),它允许我们自动执行该操作,但如果要在100多个SSIS包上执行此操作,则需要花费太多时间来保存/更新我的所有SSIS包

注意:我还使用C#api执行SSIS包

我要找的是:

  • 允许我们在SSIS脚本任务/脚本组件内继续使用版本化DLL的任何解决方案
  • 如果在没有SSIS 2012的情况下修复了此问题
下面是我得到的错误:

Microsoft.SqlServer.Dts.Runtime.TaskHost/中的
错误:
System.Reflection.TargetInvocationException:调用的目标已引发异常。-->System.IO.FileNotFoundException:无法加载文件或程序集“CustomDLL,版本=1.0.0.0,区域性=中性,PublicKeyToken=119c04fbde27c5df”或其依赖项之一。系统找不到指定的文件。
文件名:“CustomDLL,版本=1.0.0.0,区域性=中性,PublicKeyToken=119c04fbde27c5df”
在STúu 240ac16d255540ce822401f59c67e591.csproj.ScriptMain.Method1()上
位于STúu 240ac16d255540ce822401f59c67e591.csproj.ScriptMain.Main()
警告:程序集绑定日志记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。
---内部异常堆栈跟踪的结束---
在System.RuntimeMethodHandle.\u InvokeMethodFast(对象目标、对象[]参数、SignatureStruct&sig、MethodAttributes方法属性、RuntimeTypeHandle类型所有者)
位于System.RuntimeMethodHandle.InvokeMethodFast(对象目标、对象[]参数、签名符号、方法属性、方法属性、RuntimeTypeHandle类型所有者)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj、BindingFlags invokeAttr、绑定器绑定器、对象[]参数、CultureInfo区域性、布尔skipVisibilityChecks)
在System.Reflection.RuntimeMethodInfo.Invoke(对象obj、BindingFlags invokeAttr、绑定器绑定器、对象[]参数、CultureInfo区域性)
位于System.RuntimeType.InvokeMember(字符串名称、BindingFlags BindingFlags、绑定器绑定器、对象目标、对象[]提供的参数、参数修改器[]修饰符、CultureInfo区域性、字符串[]namedParams)
位于System.Type.InvokeMember(字符串名称、BindingFlags invokeAttr、绑定器绑定器、对象目标、对象[]参数、CultureInfo区域性)

在Microsoft.SqlServer.Dts.Tasks.ScriptTask.vstatasksscriptingEngine.ExecuteScript()中,特定版本不用于此目的。您需要在配置文件中设置绑定策略,这将允许在运行时接受一个程序集版本号而不是另一个程序集版本号。签出-它比我解释的更好。

看起来你需要一个绑定策略。这就是我必须做的,你链接的帖子最终帮助我在MSDN上找到了这些。我能够在机器配置中解决这个问题,或者在配置中为任何被称为DTSAPI的东西设置绑定重定向。
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