title: How do I resolve 'Failed to find or load the registered .Net Framework Data Provider'?
body: <p>I'm trying to start a .net C# application that I have been developing in a local IIS instance. So far I have been using the application by running it using IISExpress from within VS 2013. </p>
  
  <p>When I created a virtual directory and then visited the webapp I saw the following error:</p>
  
  <pre><code>Line 61:             using (OlgaDbModelEntity ctx = new OlgaDbModelEntity())
  Line 62:             {
  Line 63:                 cultureId = ctx.SYSTEM_OPTION.Where(c =&gt; c.OPTIONCODE == AppConstants.DefaultCulture).Select(c =&gt; c.OPTIONVALUE.Trim()).FirstOrDefault();
  Line 64:             }
  Source File: c:\code\OlgaWeb\Cat.Olga.Server.BussinessLogic\Culture\CultureHelper.cs    Line: 63 
  
  Stack Trace: 
  
  
   [ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.]
   System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) +2241146
    System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +151
    System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +575
    System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +144
    System.Data.Entity.Internal.LazyInternalConnection.Initialize() +95
    System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +16
    System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +269
    System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
    System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +71
    System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
    System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +44
    System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +85
    Cat.Olga.Server.BussinessLogic.Culture.CultureHelper.GetApplicationDefaultCulture() in c:\code\OlgaWeb\Cat.Olga.Server.BussinessLogic\Culture\CultureHelper.cs:63
    Cat.Olga.Server.BussinessLogic.Application.ApplicationLogic.Cat.Olga.Server.BussinessLogic.Interface.IApplicationLogic.GetApplicationDefaultCulture() in c:\code\OlgaWeb\Cat.Olga.Server.BussinessLogic\Application\ApplicationLogic.cs:283
    Cat.Olga.Client.App.MvcApplication.OlgaApplicationStart() in c:\code\OlgaWeb\Cat.Olga.Client.App\Global.asax.cs:114
    Cat.Olga.Client.App.MvcApplication.Application_Start() in c:\code\OlgaWeb\Cat.Olga.Client.App\Global.asax.cs:108
  
   [HttpException (0x80004005): Failed to find or load the registered .Net Framework Data Provider.]
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12951237
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
  
   [HttpException (0x80004005): Failed to find or load the registered .Net Framework Data Provider.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12968244
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12807949
  </code></pre>
  
  <p>My Web.config has:</p>
  
  <pre><code>&lt;DbProviderFactories&gt;
          &lt;!-- Remove in case this is already defined in machine.config --&gt;
          &lt;remove invariant="Oracle.DataAccess.Client"/&gt;
          &lt;add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/&gt;
  &lt;/DbProviderFactories&gt;
  </code></pre>