.NET Development
Upgrading VS2013 Project to 2019 - New Computer - "Unable to find the requested .Net Framework Data Provider"
Gravatar is a globally recognized avatar based on your email address. Upgrading VS2013 Project to 2019 - New Computer - "Unable to find the requested .Net Framework Data Provider"
  Chi Chi
  All
  Oct 10, 2019 @ 07:28am

Hello,

I have searched around the internet for a solution to my problem but I have yet to solve it after several hours of debugging.

I have a project that was developed a while back using Visual Studio 2010, Visual FoxPro 9.0, West Wind, and Entity Framework. We then got Visual Studio 2013 which is where the project has been edited ever since and everything is working just fine.

We would like to bring the project up to speed with newer technology. But I am getting an error just by opening the project within a newer version of Visual Studio. But the error is probably due to it being loaded on a different machine I am thinking.

Can anyone help me out?


Exception: 'The specified store provider cannot be found in the configuration, or is not valid.'

Inner Exception: Unable to find the requested .Net Framework Data Provider. It may not be installed.


Stack Trace:

[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.] System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1021875 System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +27

[ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.] System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +90 System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +503 System.Data.EntityClient.EntityConnection..ctor(String connectionString) +47 System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +78 System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +32 System.Data.Entity.Internal.LazyInternalConnection.Initialize() +129 System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +13 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +274 System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes() +50 System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext() +25 Lender.BusinessObjects.VfpEfBusinessObjectBase2.SetCodepage(TContext context, String codepage) in Q:\visual-studio\Lender.BusinessObjects\VfpEfBusinessObjectBase.cs:112 Lender.BusinessObjects.VfpEfBusinessObjectBase2.CreateContext() in Q:\visual-studio\Lender.BusinessObjects\VfpEfBusinessObjectBase.cs:104 Lender.BusinessObjects.VfpEfBusinessObjectBase`2..ctor() in Q:\visual-studio\Lender.BusinessObjects\VfpEfBusinessObjectBase.cs:86 Lender.BusinessObjects.LenderBizObj..ctor() +41

Gravatar is a globally recognized avatar based on your email address. re: Upgrading VS2013 Project to 2019 - New Computer - "Unable to find the requested .Net Framework Data Provider"
  Chi Chi
  Rick Strahl
  Oct 11, 2019 @ 12:10pm

Thank you for the fast response. I have been trying all day to get the project to work but still without success.

The project in question has been brought up to MVC 4.6.1 with EF6 using VS2019. All packages have been updated to the latest version and yet I am still receiving the same error message.

System.ArgumentException: 'The ADO.NET provider with invariant name 'VfpEntityFrameworkProvider' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.'

Inner Exception: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Warning: Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Project Name: Lender.BusinessObjects Packages affected: MySql.Data.Entity

Relivant Configuration Code:


<configuration>
  <configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>

  <connectionStrings>
    <add name="VfpLenderModelContainer" 
      connectionString="
         metadata=
           res://*/Models.VfpLenderModel.csdl|
           res://*/Models.VfpLenderModel.ssdl|
           res://*/Models.VfpLenderModel.msl;
         provider=VfpEntityFrameworkProvider;
         provider connection string=
           "Provider=VFPOLEDB;
           CODEPAGE=1252;
           Ansi=False;
           Data Source=\\dfs\FoxInfo\""
         providerName="System.Data.EntityClient"
     />
  </connectionStrings>

  <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient"></remove>
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.4.0, Culture=neutral" />
    </DbProviderFactories>
  </system.data>

  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="VfpEntityFrameworkProvider2" type="VfpEntityFrameworkProvider.VfpProviderServices, VfpEntityFrameworkProvider" />
    </providers>
  </entityFramework>

Do you see anything that stands out?

Gravatar is a globally recognized avatar based on your email address. re: Upgrading VS2013 Project to 2019 - New Computer - "Unable to find the requested .Net Framework Data Provider"
  Rick Strahl
  Chi Chi
  Oct 11, 2019 @ 01:53pm

The short of it is you're missing the entity framework provider assembly.

I haven't used this so I'm not 100% sure, but I think you can add the VfpEntityFrameworkProvider NuGet package to your project and that should probably do the trick. If that's not it, check on the Github site to see how the provider needs to be registered, perhaps as an assembly in the GAC.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Upgrading VS2013 Project to 2019 - New Computer - "Unable to find the requested .Net Framework Data Provider"
  Chi Chi
  Rick Strahl
  Oct 17, 2019 @ 12:38pm

Rick,

Thank you for your help. I was able to resolve my issue by removing "2" from the line:

<provider invariantName="VfpEntityFrameworkProvider2" type="VfpEntityFrameworkProvider.VfpProviderServices, VfpEntityFrameworkProvider" />

I followed a guide online for upgrading MVC and EntityFramework that suggested VfpEntityFrameworkProvider2 is an updated Data Provider for EF6. I am not sure what went wrong, or why I am able to exclude it from my project, but all seems to be working fine now.

Thank you for your time and assistance. I appreciate it!!

-Chris

© 1996-2019