cancel
Showing results for 
Search instead for 
Did you mean: 

Entity Framework 6.* provider

Former Member
13,566

It has been a long time since Entity Framework 6 has been released. Any ideas on when we will finally get a working EF6 Provider? Having to wait for such a trivial thing like porting a working EF5 provider to EF6.* for over half a year is really disappointing.

Accepted Solutions (0)

Answers (3)

Answers (3)

jeff_albion
Product and Topic Expert
Product and Topic Expert

UPDATE: There was an additional problem with the EF6 design-first wizard found during further testing. This has now been fixed in 12.0.1.4162 and 16.0.0.2014, see CR #770760. Code-first projects should still work with the current support.

Windows x86/x64 Support Packages (12.0.1 SP 80 and above, 16.0 SP 19 and above) have been released with this update.

How to build an Entity Framework 6 Project with SQL Anywhere 12.0.1.4162 and 16.0.0.2014 and above

In order to build an Entity Framework 6 project with SQL Anywhere:

  • Install the Entity Framework 6 Tools for Visual Studio 2012 & 2013
  • Run SetupVSPackage.exe with the newly added “/v 6” option to register the Entity Framework 6 Provider (in machine.config). (Note: This replaces the current 'iAnywhere.Data.SQLAnywhere' invariant to use an EF6-compatible provider)
  • Install Entity Framework NuGet Package for the Visual Studio project. In the package manager console, type:

Install-Package EntityFramework

  • Modify the project app.config file to include the SQL Anywhere Entity Framework 6 provider. Here’s an example:

    <providers> <provider invariantname="iAnywhere.Data.SQLAnywhere" type="iAnywhere.Data.SQLAnywhere.SAProviderServices, iAnywhere.Data.SQLAnywhere.EF6, Version=16.0.0.20144, Culture=neutral, PublicKeyToken=f222fc4333e0d400"/> </providers>

  • Build the Visual Studio project.

  • Run Entity Data Model Wizard (Add -> New Item -> ADO.NET Entity Data Model).
Former Member
0 Kudos

For me "/v 6" didn't work. I had to use "/v EF6". I'm using SA 16.0.0.2158.

VolkerBarth
Contributor

FWIW, Windows 12.0.1 and 16.0 EBFs containing the EF6 provider seem to be available for some weeks: - cf. this CR note.

  • 12.0.1.4142 has been published on 2014-08-13
  • 12.0.1.4155 has been published on 2014-09-06

  • 16.0.0.2003 has been published on 2014-09-05


Note: I do not use EF, so I can't tell whether they work as expected, I just noticed the section in the EBF Readme...

 ================(Build #4142  - Engineering Case #768717)================

    The ADO.NET provider now supports Entity Framework 6. A new dll (iAnywhere.Data.SQLAnywhere.EF6.dll) 
    has been added to %SQLANY%\\Assembly\\V4.5 directory. SetupVSPackage still 
    registers the v4.5 dll. To use the new Entity Framework 6 provider, register 
    it in app.config or web.config.
...
jeff_albion
Product and Topic Expert
Product and Topic Expert

Thanks Volker for highlighting this support. Yes, we do officially now support Entity Framework 6.0.x now with the above CRs and builds.

However, there is one known issue with this support. When using the Model-first designer in EFTools 6.0, it is possible to encounter the following message:


Re Entity Framework 6 provider

This is a known bug in EF6: "EF Designer cannot load 3rd party provider if a project has not been built"

https://entityframework.codeplex.com/workitem/1869

Building the project for the first time while the EF6 assemblies are present and referenced will resolve the issue, as mentioned in the article above.

jeff_albion
Product and Topic Expert
Product and Topic Expert
0 Kudos

FYI: This particular issue has been resolved in EFTools 6.1.2 and higher. See: https://entityframework.codeplex.com/SourceControl/changeset/c76104ccffbff12f182b3280b992eba196c3625...

Now having a clean build should no longer result in the inability to find the provider and the build step listed in my other answer is not required.

I performed all the steps in the above message and STILL had the problem. I finally stumbled on the following fix on another forum (stackoverflow) and wanted to add the fix to this posting in the hope I save some poor soul the the lost time I experienced.

Note: This fix is for version 17. The fix for 12 or 16 would be the same with appropriate references changed.

You must replace the entity framework section in app.config (web.config) with the following (remove blank lines)...

<system.data>

<DbProviderFactories>

  <clear />

  <add name="SQL Anywhere 17 Data Provider" invariant="Sap.Data.SQLAnywhere" description=".Net Framework Data Provider for SQL Anywhere 17" type="Sap.Data.SQLAnywhere.SAFactory, Sap.Data.SQLAnywhere.EF6, Version=17.0.0.10094, Culture=neutral, PublicKeyToken=f222fc4333e0d400" />

</DbProviderFactories>

</system.data>

<entityframework>

<defaultConnectionFactory type="Sap.Data.SQLAnywhere.SAConnectionFactory, Sap.Data.SQLAnywhere.EF6, Version=17.0.0.10094, Culture=neutral, PublicKeyToken=f222fc4333e0d400">

</defaultConnectionFactory>

<providers>

  <provider invariantName="Sap.Data.SQLAnywhere" type="Sap.Data.SQLAnywhere.SAProviderServices, Sap.Data.SQLAnywhere.EF6, Version=17.0.0.10094, Culture=neutral, PublicKeyToken=f222fc4333e0d400" />

</providers>

</entityframework>