簡體   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