Exception during UpdatModelFromDatabase

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
jtw
Posts: 6
Joined: Mon 25 Mar 2013 21:45

Exception during UpdatModelFromDatabase

Post by jtw » Sat 26 Nov 2016 22:59

My data is in PostgreSQL 9.3. I access it using dotConnect for PostgreSQL and Entity Framework 6.0.0.0. I am running Visual Studio 2015. I have encapsulated my data access into its own project that references these .dlls.
- Devart.Data v5.0.1555.0
- Devart.Data.PostgreSql v7.6.763.0
- Devart.Data.PostgreSql.Entity.EF6 v7.6.753.0

I recently built my model from the database and it worked great. I tried to update the model today and I get this exception:
System.TypeLoadException: Could not load type 'Devart.Data.PostgreSql.PgSqlDataTable' from assembly 'Devart.Data.PostgreSql, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701'.

The app.config in the data project contains this line:
<provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity.EF6, Version=7.6.753.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />

I verified that the GAC references 7.6.753.0.

Since creating the model I transitioned from a trial license to a paid license, and had lots of problems.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Exception during UpdatModelFromDatabase

Post by Shalex » Mon 28 Nov 2016 14:38

Be aware that dotConnect for PostgreSQL includes Tools > PostgreSQL > Upgrade Wizard which should help to update the project after migrating the new provider version.
jtw wrote:I have encapsulated my data access into its own project that references these .dlls.
- Devart.Data v5.0.1555.0
- Devart.Data.PostgreSql v7.6.763.0
- Devart.Data.PostgreSql.Entity.EF6 v7.6.753.0
1. The version of Devart.Data.PostgreSql.Entity.EF6.dll should be v7.6.763.0 (instead of v7.6.753.0).
If this doesn't help, send us a small test project for reproducing the issue in our environment. In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).
jtw wrote:Since creating the model I transitioned from a trial license to a paid license, and had lots of problems.
2. Please describe other problems you have encountered.

jtw
Posts: 6
Joined: Mon 25 Mar 2013 21:45

Re: Exception during UpdatModelFromDatabase

Post by jtw » Mon 28 Nov 2016 19:01

I ran Tools/PostgreSQL/Upgrade Wizard on 3 projects (Data, Test, WebApp). Problem didn't change.

When I changed the version of Devart.Data.PostgreSql.Entity.EF6.dll to v7.6.763.0 , the devart provider disappeared and the .edmx wouldn't load. The .dll properties of this dll indicate 7.6.753.0. I reverted this change.

When I upgraded to a paid license, The licensing page was a bit confusing so I reinstalled. I then had trouble loading libraries. Adding a reference to Devart.Data.PostgreSql.Entity.EF6.dll to v7.6.763.0 to the test project helped. I am not sure why it wasn't needed before the licensing change. The initial install of the trial license seemed very smooth once I found the configuration pages. Changing to a paid license seemed awkward.

jtw
Posts: 6
Joined: Mon 25 Mar 2013 21:45

Re: Exception during UpdatModelFromDatabase

Post by jtw » Mon 28 Nov 2016 19:37

I have been looking for reasons that the correct dll wasn't loading. I now wonder if the right dll is the problem. Here is the error with the first few frames of the stack trace:
Unable to generate the model because of the following exception: 'System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.TypeLoadException: Could not load type 'Devart.Data.PostgreSql.PgSqlDataTable' from assembly 'Devart.Data.PostgreSql, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701'.
at Devart.Data.PostgreSql.Entity.m.f()
at Devart.Data.PostgreSql.Entity.m.a(CommandBehavior A_0)
at Devart.Data.PostgreSql.Entity.m.b(CommandBehavior A_0)

The code is in Devart.Data.PostgreSql when it fails looking for Devart.Data.PostgreSql.PgSqlDataTable. I peek inside Devart.Data.PostgreSql v7.6.763.0 and I can't find Devart.Data.PostgreSql.PgSqlDataTable. I see PgSqlDataSourceEnumerator followed by PgSqlDateRange.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Exception during UpdatModelFromDatabase

Post by Shalex » Tue 29 Nov 2016 18:47

The PgSqlDataTable class and the Entity Framework support are available only in the Professional edition of dotConnect for PostgreSQL: https://www.devart.com/dotconnect/postg ... tions.html. Please specify your current edition via the Tools > PostgreSQL > About menu of Visual Studio.

jtw
Posts: 6
Joined: Mon 25 Mar 2013 21:45

Re: Exception during UpdatModelFromDatabase

Post by jtw » Thu 01 Dec 2016 00:00

Thank you for the link to the versions table. I have a couple of points of feedback.

The versions table looks like a great document if you are a developer and need to know what to turn off in each version. It is less useful if you are a user trying to decide what you need to buy to get your job done. I recommend text like "You can't create models from an existing database using the standard edition".

It would also be great if the result of trying to create a model from an existing database using the standard edition was an error message indicating that the requested functionality is not supported using the licensed version rather than an exception saying that a symbol couldn't be loaded in a dll. I spent from Saturday to Tuesday blocked by this problem

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Exception during UpdatModelFromDatabase

Post by Shalex » Thu 01 Dec 2016 09:29

Standard Edition includes neither Entity Developer (to run Create Model Wizard) nor Devart.Data.PostgreSql.Entity.EF6.dll assembly. So a scenario you have encountered should not occur by design. Looks like the assebmlies from trial version were cached in your project.

jtw
Posts: 6
Joined: Mon 25 Mar 2013 21:45

Re: Exception during UpdatModelFromDatabase

Post by jtw » Sat 03 Dec 2016 08:25

How do I upgrade to the version that I need?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Exception during UpdatModelFromDatabase

Post by Shalex » Mon 05 Dec 2016 09:23

jtw wrote:
Shalex wrote:The PgSqlDataTable class and the Entity Framework support are available only in the Professional edition of dotConnect for PostgreSQL: https://www.devart.com/dotconnect/postg ... tions.html. Please specify your current edition via the Tools > PostgreSQL > About menu of Visual Studio.
Thank you for the link to the versions table. I have a couple of points of feedback.
As I understood from your response, you confirmed that your current edition is Standard. But our Sales department states that your email address is registered for the Professional edition.

Please navigate to the Tools > PostgreSQL > About menu of Visual Studio and specify your edition (a) and full version (b).

Post Reply