Bug connecting to postgres

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
nepo
Posts: 4
Joined: Fri 23 Apr 2021 12:35

Bug connecting to postgres

Post by nepo » Fri 23 Apr 2021 13:10

I'm having problems connecting to postgres when creating a new model in Entity developer 6.11.1219.

Steps:
- Click in "New Model" in the initial page of Entity developer
- Select "EF core model" in the wizard and click "Create"
- Select "Database first" in the wizard and click "Next"
- Select NPGSQL provider in the drop down menu
- Fill in the connection parameters
- Click "Next" or "Test connection"

The following error appears (Translated to english):

Code: Select all

Could not load the file or assembly 'System.Threading.Channels, Version=4.0.2.0, Culture=neutral,
 PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the specified file.
Am I missing something or doing something wrong?
I tried contacting Devart support via email twice and got no answer; I really need this working.

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

Re: Bug connecting to postgres

Post by Shalex » Fri 23 Apr 2021 17:33

nepo wrote: Fri 23 Apr 2021 13:10

Code: Select all

Could not load the file or assembly 'System.Threading.Channels, Version=4.0.2.0, Culture=neutral,
 PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the specified file.
Please follow the steps:

1. Upgrade your Entity Developer to the newest version 6.11.1219 (https://www.devart.com/entitydeveloper/ ... story.html).

2. Create a .NET Core project in your Visual Studio 2019, navigate to Tools > NuGet Package Manager > Package Manager Console and run
Install-Package Npgsql -Version 6.0.0-preview3

This should download the npgsql provider to C:\Users\YOUR_OS_USER\.nuget\packages\npgsql\6.0.0-preview3\ .

3. Try using npgsql in a standalone Entity Developer again. Is it working now?
nepo wrote: Fri 23 Apr 2021 13:10 I tried contacting Devart support via email twice and got no answer; I really need this working.
We have answered you on Apr 22 via email. Please check the spam filter of your email box.

nepo
Posts: 4
Joined: Fri 23 Apr 2021 12:35

Re: Bug connecting to postgres

Post by nepo » Mon 26 Apr 2021 12:48

Hello shalex,
I tried following these steps in a formatted machine, nothing except VS 2019 preview and Entity developer 6.11.1219 installed, and got a similar error:

Code: Select all

Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, 
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
The project I created was for .net core 3.1.

I looked through my spam and the custom filters in my account but couldn't find the email from April 22nd. Just to be sure the address you're using is correct, here is it again:
[email protected]

nepo
Posts: 4
Joined: Fri 23 Apr 2021 12:35

Re: Bug connecting to postgres

Post by nepo » Mon 26 Apr 2021 13:01

I tried installing the version of "System.Threading.Tasks.Extensions" mentioned in the error message, then I got an error on "System.Threading.Channels", I did the same and got:

Code: Select all

Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
This one I coudn't install, I get the following message in Nuget's terminal:

Code: Select all

PM> Install-Package System.Runtime.CompilerServices.Unsafe -Version 4.0.4
Restoring packages for C:\Users\henry.MARVEL\source\repos\ConsoleApp1\ConsoleApp1\ConsoleApp1.csproj...
  GET https://api.nuget.org/v3-flatcontainer/system.threading.tasks.extensions/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.runtime.compilerservices.unsafe/index.json
  OK https://api.nuget.org/v3-flatcontainer/system.runtime.compilerservices.unsafe/index.json 226ms
  OK https://api.nuget.org/v3-flatcontainer/system.threading.tasks.extensions/index.json 443ms
NU1603: ConsoleApp1 depends on System.Runtime.CompilerServices.Unsafe (>= 4.0.4) but System.Runtime.CompilerServices.Unsafe 4.0.4 was not found. An approximate best match of System.Runtime.CompilerServices.Unsafe 4.3.0 was resolved.
NU1603: ConsoleApp1 depends on System.Threading.Tasks.Extensions (>= 4.0.2) but System.Threading.Tasks.Extensions 4.0.2 was not found. An approximate best match of System.Threading.Tasks.Extensions 4.3.0 was resolved.
Install-Package : NU1605: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 5.0.0 to 4.3.0. Reference the package directly from the project to select a different version. 
 ConsoleApp1 -> Npgsql 6.0.0-preview3 -> System.Runtime.CompilerServices.Unsafe (>= 5.0.0) 
 ConsoleApp1 -> System.Runtime.CompilerServices.Unsafe (>= 4.0.4)
At line:1 char:1
+ Install-Package System.Runtime.CompilerServices.Unsafe -Version 4.0.4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 
Install-Package : Package restore failed. Rolling back package changes for 'ConsoleApp1'.
At line:1 char:1
+ Install-Package System.Runtime.CompilerServices.Unsafe -Version 4.0.4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 

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

Re: Bug connecting to postgres

Post by Shalex » Tue 27 Apr 2021 08:43

We cannot reproduce the issue in our environment.

As a workaround, please install Npgsql into GAC.

nepo
Posts: 4
Joined: Fri 23 Apr 2021 12:35

Re: Bug connecting to postgres

Post by nepo » Tue 27 Apr 2021 12:05

I followed your instructions in another machine and it worked.
I still don't understand what happened but it's working now.
Thank you!

TyraNoah
Posts: 1
Joined: Thu 13 May 2021 21:34

Re: Bug connecting to postgres

Post by TyraNoah » Thu 13 May 2021 21:38

Thank you for the instructions
they are very easy to follow and
were quite helpful.

minotaurfightstore | minotaurfightstore
Last edited by TyraNoah on Thu 16 Dec 2021 18:58, edited 4 times in total.

horeakaii2
Posts: 1
Joined: Mon 17 May 2021 17:29

Re: Bug connecting to postgres

Post by horeakaii2 » Mon 17 May 2021 17:38

Your instructions are so simple and convenient to follow.

50 amp Generator

Post Reply