Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF Reverse POCO Generator: Failed to load provider EntityClient

I'm using EntityFramework Reverse POCO Generator in VS2012

VS2012...

Here's my connection string:

<connectionStrings>
    <add name="Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&quot;data source=C:\SomeDatabase.sdf&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  • installed nuget EntityFramework.SqlServerCompact
  • installed Entity Framework 6.1.0 Tools for Visual Studio
  • added System.Data.Entity to my references

Updated the .tt file to point to my connectionString and I get this error (warning) when I save::

Warning 1 Running transformation: Failed to load provider "System.Data.EntityClient" - Unable to find the requested .Net Framework Data Provider. It may not be installed.

So it is not generating any code. Any ideas?

here's a snippet of the Database.tt file:

<#@ include file="EF.Reverse.POCO.Core.ttinclude" #>
<#
    // v2.5.0
    // Please make changes to the settings below.
    // All you have to do is save this file, and the output file(s) is/are generated. Compiling does not regenerate the file(s).

    // Misc settings **********************************************************************************************************************
    // Namespace = ""; // Override the default namespace here
    DbContextName = "MyContext";
    ConnectionStringName = "Entities";  // Searches for this connection string in config files listed below
    ConfigurationClassName = "Configuration"; // Configuration, Mapping, Map, etc. This is appended to the Poco class name to configure the mappings.
    ConfigFilenameSearchOrder = new[] { "app.config", "web.config", "app.config.transform", "web.config.transform" }; // Add more here if required. The config files are searched for in the local project first, then the whole solution second.
    MakeClassesPartial = true;
    ...
like image 363
K. R. Avatar asked Jun 19 '14 17:06

K. R.


1 Answers

Found the answer, the problem was in the ConnectionString

should be as follows:

  <connectionStrings>
    <add name="Entities" connectionString="Data Source=C:\StoreContainer.sdf"
      providerName="Microsoft.SqlServerCe.Client.4.0" />
  </connectionStrings>
like image 51
K. R. Avatar answered Sep 30 '22 18:09

K. R.