gpt4 book ai didi

sql-server - 在 SQL Server 2016 代理作业中找不到自定义 dll

转载 作者:行者123 更新时间:2023-12-05 07:21:54 24 4
gpt4 key购买 nike

我在 SQL Server 2016 中有一个 ssis 包,它使用我在 gac 中添加的自定义 dll。 SSIS 包在 visual studio 中运行良好,但是当我将它部署到 SQL Server 上时,它找不到来自 gac 的 dll。

谁能帮我把那个自定义 dll 放在哪里?

我在我的任务脚本中添加了异常处理并将日志保存在一个文本文件中

System.IO.FileNotFoundException: Could not load file or assembly 'abc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

File name: 'abc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

at ST_7a052dcdad9e4fe18bb49852****.Job.runTask()
at ST_7a052dcdad9e4fe18bb49852****.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].

最佳答案

有两种可能的原因:

  1. 32/64 位冲突:确保您运行的模式与 dll 版本相关。尝试在 SQL 作业中以 32 位模式运行包:

  2. 将注册的dll复制到SQL程序集路径:%ProgramFiles%\Microsoft SQL Server\<SQL Version>\SDK\Assemblies然后注册到GAC。还要确保这是包中引用的路径

解决方法

使用 AssemblyResolve 函数:

关于sql-server - 在 SQL Server 2016 代理作业中找不到自定义 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56727291/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com