【问题标题】:ADODB in ASP.NET Reference IssueASP.NET 中的 ADODB 参考问题
【发布时间】:2013-04-24 11:12:21
【问题描述】:

我有一个基于 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'

.

【问题讨论】:

    标签: c# asp.net com adodb


    【解决方案1】:

    把它放在你的 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。我该如何创建一个?我过去从不需要它们。
    • 只需将其添加到您的项目中,如下所述:support.microsoft.com/kb/815179/en
    • 我已经添加了 Web.Config 文件,但是问题没有改变。
    • 您是否还在项目中添加了引用(对 ADODB)?在解决方案资源管理器上->右键单击您的项目->添加参考
    • 没有项目。我使用基于文本的编辑器在上面的文件夹中创建了上面列出的文件。我没有在 IDE 中创建项目。
    猜你喜欢
    • 1970-01-01
    • 2010-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-19
    • 1970-01-01
    相关资源
    最近更新 更多