简体   繁体   中英

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

I have about ~100 SSIS packages that are in charge of migrating data from one product to another product. These packages almost always include at least one script task and/or script component that use a custom DLL that is built in .NET 3.5 and is strongly named. Every time I have referenced it in a package we make sure that the reference has the property "Specific Version" set to false. On the environments I deploy the SSIS packages to, the DLL has been GAC'ed using gacutil.exe as well as dumped in SQL Servers assembly cache.

The problem I am encountering is that my custom DLL's version increases with every build from TFS. From the research I have done it seems like the references "Specific Version" property has no effect. Since we developed with 1.0.0.0 of the DLL it is still looking for that version. The only way I have been able to solve this is by opening every script task that needs it within the SSIS Package and simply saving. This is not a viable option. I have also found a blog post ( http://dougbert.com/blog/post/Recompile-VSTA-scripts-programmatically-in-SSIS.aspx ) that would let us automatically perform that operation but with 100+ SSIS packages to perform this on it would take too much time save/update all of my SSIS packages

Note: I also am executing the SSIS packages using the C# api.

  • Any solution that allows us to continue using a versioned DLL inside of an SSIS Script Task/Script Component
  • If this problem is fixed without 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

Specific Version is not used for that purpose. You need to set up a binding policy in a config file(s), which will enable one assembly version number to be accepted in place of another at runtime. Check out this link - it explains everything far better than I can.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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