title: Could not load file or assembly 'Oracle.ManagedDataAccess.EntityFramework
body: <p>I'm getting this error when i want to start my asp.net web app</p>
  
  <pre><code>The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) 
  ...
  
  Line 22:     {
  Line 23:         public ApplicationDbContext()
  Line 24:             : base("DefaultConnection", throwIfV1Schema: false)
  Line 25:         {
  Line 26:         }
  </code></pre>
  
  <p>Its MVC web app connected to oracle database and I used EntinyFramework 6.1.3  over NuGet,</p>
  
  <p>I'm using windows 7 64-bit,
  V.Studio 2015
  and 32-bit ODAC 12c Release 4</p>
  
  <p>I tried to set in Visual studio to start in x64 or x86, doesn't help..</p>
  
  <p>Please give me some advice. Thank you.</p>
  
  <p>Code behind:
  Web.config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="Oracle.ManagedDataAccess.Client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.12.1.0.2.4, Culture=neutral, PublicKeyToken=89b483f429c47342"/&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;sectionGroup name="devExpress"&gt;
        &lt;section name="themes" type="DevExpress.Web.ThemesConfigurationSection, DevExpress.Web.v16.1, Version=16.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" /&gt;
        &lt;section name="compression" type="DevExpress.Web.CompressionConfigurationSection, DevExpress.Web.v16.1, Version=16.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" /&gt;
        &lt;section name="settings" type="DevExpress.Web.SettingsConfigurationSection, DevExpress.Web.v16.1, Version=16.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" /&gt;
        &lt;section name="errors" type="DevExpress.Web.ErrorsConfigurationSection, DevExpress.Web.v16.1, Version=16.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" /&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-WebApplication1-20160811110342.mdf;Initial Catalog=aspnet-WebApplication1-20160811110342;Integrated Security=True"
        providerName="System.Data.SqlClient" /&gt;
      &lt;add name="Model1" connectionString="DATA SOURCE=XXXXX;PERSIST SECURITY INFO=True;USER ID=XXXX"
        providerName="Oracle.ManagedDataAccess.Client"/&gt;
      &lt;add name="xpf.printing" connectionString="xpoprovider=MSSqlServer;data source=(localdb)\mssqllocaldb;attachdbfilename=|DataDirectory|\ReportService.mdf;integrated security=True;connect timeout=120" /&gt;
    &lt;/connectionStrings&gt;
    ....
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="mssqllocaldb" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=4.12.1.0.2.4, Culture=neutral, PublicKeyToken=89b483f429c47342"/&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    ....
  &lt;/configuration&gt;
  </code></pre>
  
  <p>IdentityModels.cs :</p>
  
  <pre><code>using System.Data.Entity;
  using System.Security.Claims;
  using System.Threading.Tasks;
  using Microsoft.AspNet.Identity;
  using Microsoft.AspNet.Identity.EntityFramework;
  
  namespace WebApplication1.Models
  {
      // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
      public class ApplicationUser : IdentityUser
      {
          public async Task&lt;ClaimsIdentity&gt; GenerateUserIdentityAsync(UserManager&lt;ApplicationUser&gt; manager)
          {
              // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
              var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
              // Add custom user claims here
              return userIdentity;
          }
      }
  
      public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
      {
          public ApplicationDbContext()
              : base("DefaultConnection", throwIfV1Schema: false)
          {
          }
  
          public static ApplicationDbContext Create()
          {
              return new ApplicationDbContext();
          }
      }
  }
  </code></pre>