运行Web程序,报错:
Could not load file or assembly 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
解决
- copy the gacutil.exe (../Program Files/Microsoft Visual Studio 8/SDK/v2.0/Bin) to the destination pc.
- copy adodb.dll(../Program Files/Microsoft.NET/Primary Interop Assemblies) to the destination pc.
- copy stdole.dll(../Program Files/Microsoft.NET/Primary Interop Assemblies) to the destination pc.
- run gacutil /i adodb.dll to register the adodb to the gac.
说明: 全局程序集缓存工具(gacutil.exe) 程序集查看器可以使用Windows浏览器查看和删除程序集,但不能在脚本代码中使用该工具,例如创建安装程序。gacutil.exe工具可以使用命令行安装、卸载和显示程序集。 gacutil的一些选项如下所示: ● gacutil /l 显示程序集缓存中的所有程序集。 ● gacutil /i mydll把共享程序集mydll安装到程序集缓存上。 ● gacutil /u mydll 卸载程序集mydll。 ● gacutil /ungen mydll 从本机图像缓存中卸载程序集。
通过注册可以看到C:/WINDOWS/assembly中已经加入了ADODB
能过指令gacutil /l所列示的程序集也即是C:/WINDOWS/assembly中所列之程序集
在运行Web程序时遇到ADODB程序集加载错误,系统找不到文件。解决方案包括将gacutil.exe复制到目标计算机,将adodb.dll和stdole.dll也一并复制,并使用gacutil /i命令注册adodb.dll到全局程序集缓存。完成注册后,可以在C:/WINDOWS/assembly中看到ADODB已成功加入。

872

被折叠的 条评论
为什么被折叠?



