我有一个基于ASP.NET的Web应用程序。我手动创建了所有文件夹,因此完整的结构如下所示。
ROOT
sendmail.aspx
Web.config
App_Code
sendmail.cs
bin
Interop.ADODB.dll
Interop.CDO.dll
我的web.config如下
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="ADODB, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</assemblies>
</compilation>
</system.web>
</configuration>
此设置过去一直有效。但是,我们最近将测试计算机更新到Windows 7.服务器是Windows Server 2005.我知道有关ADODB的7 sp1和旧版本之间存在弃用问题。我已经为此安装了修补程序,并重新编译了dll,然后将它们移动到服务器。但是,现在我在编译时收到以下错误。我不确定它为什么没有正确引用dll。
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0012: The type 'ADODB.Fields' is defined in an assembly that is not referenced. You must add a reference to assembly 'ADODB, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'
答案 0 :(得分:0)
将它放在你的web.config中:
<configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="ADODB, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</assemblies>
</compilation>
</system.web>
</configuration>
应该修复你的错误