Error Message: The Execute method on the task returned error code 0x80131621 (Mixed mode assembly is built against version ‘v2.0.50727‘ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.). The Execute method must succeed, and indicate the result using an "out" parameter.
Solution: 因为编译时引用的dll使用了不同的.NET Framework版本,需要添加 useLegacyV2RuntimeActivationPolicy=”true”
<configuration>
<startup useLegacyV2RuntimeActivationPolicy=”true”>
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″/>
</startup>
</configuration>
参考: http://www.daimto.com/execute-ssis-packages-with-c/
时间: 2024-10-08 14:27:27