当我未引用文件或程序集Oracle.ManageddataAccess时,它无法加载

时间:2019-08-05 18:38:18

标签: c# asp.net reference

我不断得到

  

System.IO.FileNotFoundException:'无法加载文件或程序集   'Oracle.ManagedDataAccess,版本= 4.122.1.0,区域性=中性,   PublicKeyToken = 89b483f429c47342或其依赖项之一

当我尝试检查角色是否存在时出现

错误。问题是引用了非托管数据访问“ Oracle.DataAccess.dll”,而没有托管!

我检查了web.config和所有引用,但看不到此托管数据访问引用的来源。有什么想法吗?

using System;
using System.Web;
using System.Web.Security;
using System.Web.Routing;

public class Global : HttpApplication
{
    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        if (Roles.Enabled)
        {
            if (!Roles.RoleExists("User"))  <--- Error pops up here
            {
                Roles.CreateRole("User");
            }
            ...
        }
    }
}

在web.config中:

<compilation defaultLanguage="c#" debug="true" targetFramework="4.6">
  <assemblies>
    <add assembly="Oracle.DataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
    <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.DirectoryServices.AccountManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  </assemblies>
</compilation>
....
<roleManager enabled="true" defaultProvider="AHSOracleRoleProvider">
  <providers>
    <add name="AHSOracleRoleProvider" type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="AHSConnectionString" applicationName="/"/>
  </providers>
</roleManager>

0 个答案:

没有答案