我在 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].
最佳答案
有两种可能的原因:
32/64 位冲突:确保您运行的模式与 dll 版本相关。尝试在 SQL 作业中以 32 位模式运行包:
将注册的dll复制到SQL程序集路径:%ProgramFiles%\Microsoft SQL Server\<SQL Version>\SDK\Assemblies
然后注册到GAC。还要确保这是包中引用的路径
解决方法
使用 AssemblyResolve 函数:
https://stackoverflow.com/questions/56727291/
相关文章:
amazon-web-services - 如何终止到 elb 的 HTTPS 流量并且容器正在运行
linux - devtoolset-7 STL_vector.h 未定义对 `std::__thr
python - 在 Python3.7 之前的版本中,应该如何在 argparse-module
python-3.x - 如何在 Google Cloud Composer 中设置 chromed
scala - 使用 AWS s3 的分段上传 API 时出现内存不足问题
c# - 观察并删除(截图),如果在Iphone中使用我的App时截图
google-kubernetes-engine - 无法将 gsutil 与 GKE 集群的工作负