Excel automation add-in using dotConnect for PostgreSQL

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 4
Joined: Wed 29 Jun 2016 13:34

Excel automation add-in using dotConnect for PostgreSQL

Post by bbell@ctscap.com » Sun 19 Feb 2017 18:18

I am attempting to create an Excel automation add-in using VS2013 / C# / dotConnect for PostgreSQL 7.6.699.0 / Entity Framework 6 / Excel 2016. It also uses EF6 to SQL Server.

When I call the add-in from a .Net console application, it works fine. When I call it from Excel the EF6 / SQL Server part works fine, but when I try to access PostgreSQL I get the error:
No Entity Framework provider found for the ADO.NET provider with invariant name 'Devart.Data.PostgreSql'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
I have App.config and an ExcelUDFAsCom.dll.config files, both containing:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameter value="mssqllocaldb" />
      <provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity.EF6, Version=7.6.699.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
I have tried several different things trying to get the PostgreSQL provider to be recognized, including copying the ExcelUDFAsCom.dll.config file into the program files folder that contains Excel.exe. Nothing works.

What can I do to get this to work? Thanks.

Site Admin
Posts: 8241
Joined: Thu 14 Aug 2008 12:44

Re: Excel automation add-in using dotConnect for PostgreSQL

Post by Shalex » Mon 20 Feb 2017 16:06

In case of Excel add-in, please use code-based registration (instead of config file registration): http://blog.devart.com/entity-framework ... #CodeBased.

Post Reply