Skip to content

DLLNotFoundException (32/64 bits problem with the DLL probably) #3919

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

Closed
JomanjiPT opened this issue Jun 27, 2019 · 6 comments
Closed

DLLNotFoundException (32/64 bits problem with the DLL probably) #3919

JomanjiPT opened this issue Jun 27, 2019 · 6 comments
Assignees
Labels
bug Something isn't working P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away.

Comments

@JomanjiPT
Copy link

System information

  • OS version/distro: windows 10 (64 bits) and windows server 2012 R2 (64 bits)
  • .NET Version (eg., dotnet --info): .Net Framework 4.7.2

Issue

  • What did you do? I copied the project from my computer (windows 10) to a server (windows server 2012 R2) and I started to have problems with "DLLNotFoundException".

  • What happened? When I copy the project from my computer ( ...\Desktop\ICN) to the server, the path of the project became "\nameOfServer...\ICN" (the Network Path) and when I debug, on my computer (windows 10), that same project I get "DLLNotFoundException".

  • What did you expect? I expected to run on the two computers equaly.

Source code / logs

As a side note, my solution has 3 projects: "DataCollection", "RS_WebApp" (where is the method that uses ML.NET) and "NetworkGraph".

Image of the problem:
https://imgur.com/a/SMBmPPW (first image)

My projects it's on "Any CPU" when I debug and with the project, ASP.NET Web Application (.NET Framework), "RS_WebApp" on 64 bits that ML.NET requires and the other 2 projects on "Any CPU".

https://imgur.com/a/SMBmPPW (second image)

I am using the "mlContext.Recommendation().Trainers.MatrixFactorization(options)" and when I build the application it generates the "MatrixFactorizationNative.dll" on "\ICN\RS_WebApp\bin".

The only way that I put to work fine, when debug, was putting this dll on the "C:\Windows\SysWOW64" (in my computer) (ML.NET requires 64 bits) but the problem is that it doesn't work when it's the server calling that method because it doesn't have that file in its folder "C:\Windows\SysWOW64" (or similar to that in windows server) and I can't put that file in the server.

I already tried to put the dll on the project with "Copy to Output Directory: Copy if newer" and it didn't work.

https://imgur.com/a/SMBmPPW (third image)

I also put manually the dll on "\ICN\RS_WebApp\bin\x64" and it didn't work.

I also tried to "Add Reference" on the project (that have the web service with the web method that calls ML.NET "RS_WebApp") the dll but this error happen.

https://imgur.com/a/SMBmPPW (fourth image)

I don't know what folder I can put the dll on, to correctly load that dll.

My thoughts on this are the following:

  • something related with debugging a solution with 1 project 64 bits and 2 projects 32 bits, and it "misses" where was the dll for the 64 bits project.
  • ML.NET (web API) can have some problem with files in a computer and running on other.

If you need more information, feel free to ask, and a huge thanks if someone can address this problem.

@JomanjiPT
Copy link
Author

RS_WebApp.zip
Here, It goes the .csproj of the project that have that issue.
I already read like over 50 stackoverflow and github discussions, and I can't find a solution to this problem. I will be much appreciated if someone can help with this pls.

@ganik ganik added bug Something isn't working P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away. labels Jan 10, 2020
@veronicaorozco
Copy link

Hola, tengo el mismo problema, lo lograste solucionar?

@JomanjiPT
Copy link
Author

I had to put the "MatrixFactorizationNative.dll" into the "C:\Windows\SysWOW64" of the server (windows server 2012 R2).

@antoniovs1029
Copy link
Member

Hi, @JomanjiPT since you've found the solution for your problem I will close this issue. Please, feel free to reopen it if you're still having problems with this. Thanks!

@admin131
Copy link

@JomanjiPT Yours fix didn't work on Windows Server 2016 Standard (64 bits). Do You have any other good idea? :)

@elyasaf755
Copy link

elyasaf755 commented Mar 18, 2021

I have ran my app on "x64" instead on "Any CPU" and it fixed the problem.
See the following thread for more explanations:
#3764

@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away.
Projects
None yet
Development

No branches or pull requests

6 participants