Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dll loading error (randomly) #1

Open
marcomezzanotte opened this issue May 9, 2016 · 19 comments
Open

dll loading error (randomly) #1

marcomezzanotte opened this issue May 9, 2016 · 19 comments

Comments

@marcomezzanotte
Copy link

Hi, we're randomly experiencing the following error:

Unable to load DLL 'PgCPP.DLL.9.x.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) - at Npgsql.BulkCopy.Native.Versions.PQ9xNativeApi.openRemoteConn(Char hostaddr, Int32 port, Char dbname, Char user, Char password) at Enerj.CDV.Data.DataManagerBase1.InsertBulk(DataTable DT_Tabella)
at Enerj.CDV.Data.DataManager.IndicizzaDocumentInstance(List1 ListID, Int64 IDInstance) at Enerj.CDV.ControlsService.Manager.StartProcess()

The library is used in a Windows Service and the error shows after deploy and installation, while everything works fine in Visual Studio. On the server where we deploy the service, we've installed the Visual C++ Redistributable.

We hope you can give us a hint or a solution for this problem.

Thank you.

@uzbekdev1
Copy link
Owner

uzbekdev1 commented May 9, 2016

Hi!
Okay I'll tomorrow look it

@uzbekdev1
Copy link
Owner

which version your PG ? 9.5 or 9.4?
Need to update from C:\Program Files\PostgreSQL\9.5 folder lib & dll's

@marcomezzanotte
Copy link
Author

Sorry but I don't understand.

When I download the Nuget package, a folder named lipqdll with the following structure is downloaded and what I do is to copy the whole folder structure and contents to the service deployed root folder.

ad3ef972536ad54cdef7b8f78381b50c9d49a0daac049d4e03 pimgpsh_fullsize_distr

Am I wrong?
What am I supposed to do exactly?

@nonoantog
Copy link

I have the same problem. My postgres instance is on linux server.

@nicusorserban
Copy link

How we can get past this error?
I've tried to compile the .DLL but it gives me countless errors ...

@screig
Copy link
Contributor

screig commented May 16, 2017

Same issue, note im running under Net Core

@uzbekdev1
Copy link
Owner

Ok, looking today.End of this week I pushed a new version.

@Steven-FlexTechs
Copy link

I have the exact same error. I am using PG 9.5. It all works fine for my unit test project.

I get the Unable to load DLL 'PgCPP.DLL.9.x.dll': The specified module could not be found. error for my MVC web project. Same computer, same database.

I tried adding the lipqDLL folder to the bin folder which worked for my Unit Test project. Did not work still.

I wish the error said the expected directory too so I know where to put the dlls: Unable to load DLL 'C:/Project Folder/bin/PgCPP.DLL.9.x.dll': The specified module could not be found.

@uzbekdev1
Copy link
Owner

uzbekdev1 commented May 31, 2017 via email

@officer-rosmarino
Copy link

officer-rosmarino commented May 31, 2017

Same problem here, but for me it doesn't work even on Visual Studio.

@screig
Copy link
Contributor

screig commented May 31, 2017

I fixed it, I will make a pull request today to merge

I also then want to go on and use costura to embedded the C++ dlls in the Net assembly

@officer-rosmarino
Copy link

@screig waiting for it, thanks

@screig
Copy link
Contributor

screig commented May 31, 2017

Ok I have reworked the code base quite a bit

forked version

The C++ projects had hard-coded links to specific installed versions of Postgres. I have made all the C++ projects use relative paths. I also went and tried to go and find the required references, namely the lib and include files for the following versions:

  • 9.x x86
  • 9.x x64
  • 8.x x86
  • 8.x x64 (this one I could not find)

I included this data in the code base (bar 8.x x64). I rebuilt the C++ projects which regenerated the missing dlls and copied them over to the C# folder.

@officer-rosmarino
Copy link

@screig could you please point out where you did the changes?

@screig
Copy link
Contributor

screig commented May 31, 2017

sorry it is still uploading...

image

@uzbekdev1
Copy link
Owner

Thank you!

@screig
Copy link
Contributor

screig commented May 31, 2017

Ok its in

@screig
Copy link
Contributor

screig commented May 31, 2017

If anybody can find the x64 version of the postgres binaries I can add them in

@uzbekdev1
Copy link
Owner

uzbekdev1 commented May 31, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants