EDApplicationException in LinqPad with LinqConnect

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Mon 20 Aug 2018 22:50

Hi All,

First time poster here. I'm trying to set up LinqPad 5 with my existing data context but so far my attempts have failed. I've googled but the solution didn't rise to the top. I'm using windows 10 version 1803, Entity Developer 6.3.555, Postgres 10.4

Here's what I did:
1) In LinqPad 5 Click Add Connection
2) Click View More Drivers, click Browse, navigate to LinqConnectDriver.lpx
3) Observe Driver successfully update message box
4) Select the newly installed driver in the lower pane, to use my own data context
5) Click next, then navigate to my own assembly
6) observe that the details of the data context and application config filed are automatically populated.
7) add connection details (it tests successfully)
8) Observe the left pane has been populated with my tables

9) Right click on a table and select TableName.Count()
10) observe error message: "EDApplicationException: Configuration system failed to initialize"
11) hit F5
12) observe error message: "EDApplicationException: Unable to find the requested .Net Framework Data Provider. It may not be installed. The provider invariant name is 'Devart.Data.PostgreSql'."


Where am I going wrong?

Any help greatly appreciated

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Thu 23 Aug 2018 11:54

We could not support "LINQPad AnyCPU" at the moment, because the Entity Developer tool is compiled with Platform target=x86.

Please use the x86 version of LINQPad: http://www.linqpad.net/download.aspx > the "Download LINQPad 5" button.

Does this help?

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Thu 23 Aug 2018 21:39

Thanks for the reply. Unfortunately that didn't help.

I also tried the beta version that is explicitly labelled as x86 but the issue persists.

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Tue 28 Aug 2018 15:25

1. Your assembly with data context is compiled with Platform target=x86, isn't it?

2. Run your LinqPad 5 via right click > Run as administrator. Does this help?

3. Make sure that the following entry is added by LinqConnect installation to both these files
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

Code: Select all

<configuration>
  <system.data>
    <DbProviderFactories>
...
      <add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql"
        description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.11.1202.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
...
    </DbProviderFactories>
  </system.data>
</configuration>

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Tue 28 Aug 2018 23:44

Hi Shalex

thanks for the time you're spending on this.

1. Platform target=x86. Good question. It wasn't, but now I've created a new configuration which does. No change to the behaviour of Linq Pad.

2. Run as administrator: No change to behaviour when running as administrator.

3. machine.config: Both of those lines are present.

So, unfortunately, the issue persists.

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Wed 29 Aug 2018 16:15

1. Make sure that the following assemblies are created at GAC 2.0 (C:\Windows\assembly\GAC_MSIL\) by the LinqConnect installation:
* Devart.Data.dll
* Devart.Data.Linq.dll
* Devart.Data.PostgreSql.dll
* Devart.Data.PostgreSql.Linq.dll

2. Confirm that Devart.Data.PostgreSql.dll at GAC 2.0 has the same version like the one specified in machine.config.

3. Check machine.config files again if there are any duplicated entries in the DbProviderFactories section for Devart.Data.PostgreSql:
* C\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
* C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Thu 30 Aug 2018 05:06

1) This command:
dir /s /b /o:n c:\windows\assembly\GAC_MSIL\Devart.Data.* > c:\temp\devart_gac.txt
returned this output:
...
c:\windows\assembly\GAC_MSIL\Devart.Data
c:\windows\assembly\GAC_MSIL\Devart.Data.Linq
c:\windows\assembly\GAC_MSIL\Devart.Data.PostgreSql
c:\windows\assembly\GAC_MSIL\Devart.Data.PostgreSql.Linq
...
c:\windows\assembly\GAC_MSIL\Devart.Data\5.0.1994.0__09af7300eec23701\Devart.Data.dll
c:\windows\assembly\GAC_MSIL\Devart.Data.Linq\4.8.1539.0__09af7300eec23701\Devart.Data.Linq.dll
c:\windows\assembly\GAC_MSIL\Devart.Data.PostgreSql\7.11.1202.0__09af7300eec23701\Devart.Data.PostgreSql.dll
c:\windows\assembly\GAC_MSIL\Devart.Data.PostgreSql.Linq\4.8.1539.0__09af7300eec23701\Devart.Data.PostgreSQL.Linq.dll

(some lines deleted for brevity.)


2) This file:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
contains this snippet:

<system.data>
<DbProviderFactories>
...
<add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql"
description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.11.1202.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>

and this file:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
contains this snippet:
<system.data>
<DbProviderFactories>
...
<add name="dotConnect for PostgreSQL" invariant="Devart.Data.PostgreSql"
description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.11.1202.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>


3) Every other entry in the <DbProviderFactories> in each of the machine.config has a distinct name

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Thu 30 Aug 2018 15:25

1. Did you choose all components on the Select Components step of LinqConnect installation?

2. If you generate the model in LINQPad via "Build data context automatically" (instead of "Use a typed data context from your own assembly"), does it work OK?

3. Send us your assembly so that we can reproduce the error in our environment.

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Thu 30 Aug 2018 21:39

"Build data context automatically" rather than using my own assembly caused the problem.

Many thanks

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Thu 30 Aug 2018 21:50

And, F.W.I.W., I've also just realized the distinction: I have dotDonnect, not LinqConnect.

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Fri 31 Aug 2018 16:43

1. The LinqConnectDriver.lpx file is shipped only with LinqConnect installation. How did you register dotConnect for PostgreSQL in LINQPad?

2. Please install LinqConnect Professional with all components selected in the install wizard. Does this fix the issue?

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Fri 31 Aug 2018 23:07

Hi Shalex

Please excuse my previous message: it wasn't clear. I used the option "Build data context automatically" and this fixed the problem. Linq Pad is working for me now.

I only have a license for DotConnect. This file is dated 9 August 2018, same as the dlls in the same folder. I presume that it was installed when I ran dcpostgresql711pro.exe (dated 10 August)?

Should Linq Pad work with dotconnect?

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

Re: EDApplicationException in LinqPad with LinqConnect

Post by Shalex » Mon 03 Sep 2018 13:52

ssnz wrote:
Fri 31 Aug 2018 23:07
I only have a license for DotConnect. This file is dated 9 August 2018, same as the dlls in the same folder. I presume that it was installed when I ran dcpostgresql711pro.exe (dated 10 August)?
That is correct. Sorry for the previous misleading message (actually, dotConnect installation creates LinqConnectDriver.lpx as well).
ssnz wrote:
Fri 31 Aug 2018 23:07
Should Linq Pad work with dotconnect?
Yes, it should.

ssnz
Posts: 19
Joined: Mon 20 Aug 2018 21:15

Re: EDApplicationException in LinqPad with LinqConnect

Post by ssnz » Thu 06 Sep 2018 01:07

Thanks Shalex

This has stopped working since the installation of 7.11.1216.

1) Under my previous installation is worked by using the "build data context automatically" which showed that the driver version of Devart LinqConnect was 4.8.1539. I used table_name.Count() which returned the number of rows in the table.

2) Then I installed 7.11.1216 and the existing connection no longer worked. I deleted the connection and created a new one, using the "build data context automatically" option. The installed version of the driver now shows as 4.8.1553.0. On right clicking a table and selecting table_name.Count() I observe the error:
LinqCommandExecutionException: Error on opening DbConnection.

3) On attempting to use my own assembly I still get the same error message that I encountered on first writing this report.

Any ideas on how to proceed with this?

Pinturiccio
Devart Team
Posts: 2314
Joined: Wed 02 Nov 2011 09:44

Re: EDApplicationException in LinqPad with LinqConnect

Post by Pinturiccio » Fri 07 Sep 2018 09:09

We are processing your request. We will contact you as soon as possible.

Post Reply