Upgrade to Npgsql 4.0.0 LLBLGen Error

Posts   
 
    
hankddog
User
Posts: 52
Joined: 08-Apr-2005
# Posted on: 21-Jun-2018 20:50:04   

I Upgraded to the latest Npgsql 4.0.0. from 3.2.7. When I open LLBL V 5.4.1 and try to run the Relational Model Data Retrieval Wizard I get.

Exception type: FileNotFoundException Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

My dev machine is on a windows server 2016 with .Net 4.5 on it.

It was working fine with Npgsql 3.2.7

Walaa avatar
Walaa
Support Team
Posts: 14982
Joined: 21-Aug-2005
# Posted on: 22-Jun-2018 00:50:15   

Did you follow the below suggestion mentioned in the Designer docs?

To make the designer work with the Npgsql ADO.NET provider installed on your system, you have to use the installer provided by the Npgsql project at GitHub. This way, you know the DbProviderFactory is properly installed.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 22-Jun-2018 09:10:16   

The v4.0 of Npgsql has a dependency on System.ValueTuple, which comes with .NET 4.7.2 (I think, can also be 4.7.1, but one of the latest). This is a silly issue that unfortunately causes a lot of problems. To be able to use it, you need to register the system.valuetuple assembly yourself. See: https://stackoverflow.com/questions/42867434/could-not-load-file-or-assembly-system-valuetuple

(same problem, different assembly using system.valuetuple). If you did use the installer as Walaa suggested, please let us know so I can file a bug with Npgsql. Sorry for this inconvenience disappointed

Frans Bouma | Lead developer LLBLGen Pro
hankddog
User
Posts: 52
Joined: 08-Apr-2005
# Posted on: 22-Jun-2018 17:14:32   

Walaa wrote:

Did you follow the below suggestion mentioned in the Designer docs?

To make the designer work with the Npgsql ADO.NET provider installed on your system, you have to use the installer provided by the Npgsql project at GitHub. This way, you know the DbProviderFactory is properly installed.

Yes I did that part

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 23-Jun-2018 09:41:52   

Did you see my post? Did that help? If not, please let us know, so we can take this up with the Npgsql team. The main issue is that our system on .NET full reads the factory from the .NET DbProviderFactories class, which is a central .NET Class offering the registered DbProviderFactory instances. In general that .NET class should be able to instantiate the factory instance without a problem. However here, the Npgsql DbProviderFactory class has a dependency on System.ValueTuple which isn't found on your system, or at least, isn't reachable by .NET. (it's often installed through nuget when you take a dependency on the Npgsql package, but that's not possible in this case, as the route is through DbProviderFactories).

The solution is either to install .net 4.7.2, or to make sure System.ValueTuple is available in the GAC, as described in the stackoverflow link I posted.

Frans Bouma | Lead developer LLBLGen Pro