Exception during UpdatModelFromDatabase
Exception during UpdatModelFromDatabase
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.
- 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.
Re: Exception during UpdatModelFromDatabase
Be aware that dotConnect for PostgreSQL includes Tools > PostgreSQL > Upgrade Wizard which should help to update the project after migrating the new provider version.
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).
1. The version of Devart.Data.PostgreSql.Entity.EF6.dll should be v7.6.763.0 (instead of v7.6.753.0).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
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).
2. Please describe other problems you have encountered.jtw wrote:Since creating the model I transitioned from a trial license to a paid license, and had lots of problems.
Re: Exception during UpdatModelFromDatabase
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.
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.
Re: Exception during UpdatModelFromDatabase
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.
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.
Re: Exception during UpdatModelFromDatabase
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.
Re: Exception during UpdatModelFromDatabase
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
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
Re: Exception during UpdatModelFromDatabase
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.
Re: Exception during UpdatModelFromDatabase
How do I upgrade to the version that I need?
Re: Exception during UpdatModelFromDatabase
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.jtw wrote:Thank you for the link to the versions table. I have a couple of points of feedback.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.
Please navigate to the Tools > PostgreSQL > About menu of Visual Studio and specify your edition (a) and full version (b).