ASP.NET中的ADODB参考问题
问题描述:
我有一个基于ASP.NET的Web应用程序。我手工创建了所有的文件夹,所以完整的结构如下。ASP.NET中的ADODB参考问题
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.我知道7 sp1和旧版本之间在ADODB方面存在弃用问题。我已经为此安装了修补程序,并重新编译了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'
。
答
把在你的web.config:
<configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="ADODB, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</assemblies>
</compilation>
</system.web>
</configuration>
应该改正错误
我没有一个web.config。我如何去创建一个?过去我从未需要他们。 – steventnorris 2013-04-30 13:51:20
只需将其添加到您的项目,如下所述:http://support.microsoft.com/kb/815179/en – Postback 2013-04-30 13:52:31
我已经添加了Web.Config文件,但没有任何更改的问题。 – steventnorris 2013-04-30 13:58:56