I keep getting
System.IO.FileNotFoundException: 'Could not load file or assembly 'Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342 or one of its dependencies
error when I try to check for existence of a role. The problem is that have references to unmanaged data access"Oracle.DataAccess.dll" and none to managed!
I checked web.config and all the references and can't see where this managed data access reference is coming from. Any ideas?
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");
}
...
}
}
}
In 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>