In a .NET Core application, I'm getting this error when I try to run my unit test project:
System.DllNotFoundException: Unable to load DLL 'opencv_core246' or one of its dependencies: The specified module could not be found. (0x8007007E)
The DLLImport line simply uses 'opencv_core246' (no path), so my understanding is that the runtime should look in the same directory as the executable itself (or failing that Windows/System32 or Windows/SystemWOW64). It is now in all three locations just for the hell of it, but still no dice. My colleague has the same set-up (mine is a Windows VM running in Parallels on a Mac whereas as his is native Windows but that shouldn't matter) and his tests run OK. Any ideas about how to debug this one appreciated.
First of all, please don't spray DLLs all over your system. That just makes life complicated. Remove the DLLs in the system directories and never modify those directories again. They belong to the system, not you.
Now, you will get the DllNotFoundException if the DLL cannot be found, or one of its dependencies cannot be found. The DLL will be found since its alongside the executable. Ergo, one of the dependencies cannot be found. Find out what the dependencies are, and make sure they can be resolved.
I'm adding my own answer in case this is helpful to someone else. As the accepted answer indicates, I was indeed missing dependencies of the native dll (opencv_core246). The thing is how to find out what these dependencies are. I used a utility called dependency walker, but this gave rather confusing results - it seemed to indicate I was missing the windows kernel! What clarified the issue was using the dumpbin utility which comes with Microsoft's C++ compiler. You can use this like so:
dumpbin /DEPENDENTS <my.dll>
This indicated that my dll had three dependencies, the kernel plus two that are part of the C++ redist package which was not installed on my system. Installing that fixed the missing dependency issue.
EDIT: Actually dependency walker results dig deeper into the dependency tree than dumpbin, so you can use it to get the same results. The dll dependencies are at the top level of the results tree.
Related
I have successfully deployed my Qt application, with all the necessary dll files, and it works fine. However, as soon as I add something which uses Qt5Network, my program crashes with "The application was unable to start correctly (0xc000007b)".
I of course copied the Qt5Network.dll to my deployment dir, and I used a dependency walker, and found out that there was one new dependency compared to what I had before adding the "network" part: libgcc_s_seh-1.dll
I copied that as well, still the same error.
I learned that Qt Network requires OpenSSL, so I found libeay32 and ssleay32, and copied them to my deployment directory as well.
The error is the same. If I remove the requirement for Qt5Network, my program runs fine, and it uses many other modules, like Printsupport, Serialport, etc. without problem.
I tried it on Qt 5.9 and 5.15.
The official Qt binaries (Qt Network in your case) will try to load OpenSLL when first needed, at runtime, not when you first launch your application, see the SSL section here. And I believe that's the reason why dependency walker and windeployt were not able to identify OpenSSL as they can only identify load-time dependendencies.
It seems you were trying to bundle the OpenSSL binaries from an incompatible version. Starting with Qt 5.12.4 the supported OpenSSL version is 1.1.1, see for instance here. If you find the binaries from v1.1.1 and bundle those, your application should work.
I'm working on my second application in QT and i'm trying to deploy a rough copy for testing. It would not run on a test computer, runs with no problems on mine, giving the error "Procedure Entry Point _ZdaPVJ not found in QT5core.dll". So to make sure that was not my program messing things up, i created a blank test application, compile it for release, moved the test.exe to a different location, run windeployqt --release test.exe, it created all the dependencies and folders. clicked on test.exe run with no problem. grabbed the folder recently created took it to the other computer and go the same error.
Is there something that i have forgotten since i compile my first application? Did i changed some setup somewhere without realizing it?
frustrated...
Perhaps you can check if your problem is related to different versions of the dll existing on your system and the wrong one is being loaded:
QT Release build DLL procedure entry point error
https://forum.qt.io/topic/26707/the-procedure-entry-point-cound-not-be-located-in-the-dynamic-link-library
As is suggested in the latter link above (towards the bottom), you could try to use dependency walker to determine from where the dll is loaded. Or use static linking with the licensing issues that causes (also see the latter link above).
And throwing in a final link on using Qt's Window's Deployment tool: Qt deployment; the procedure entry point ... could not be located
I am getting this runtime error and can not find anything on the internet around this reference. 'Sitecore.Reflection.INexusDataApiEx'
Any assistance would be greatly appreciated.
Errors like this are usually seen after upgrading or some mismatch in dependencies in your solution. As 'Climber' mentioned, get the zip for a clean version of Sitecore, exactly matching the version you are using (not just "8.1" but also the correct minor update-x version). Verify that your Sitecore.Kernel.dll is the same as the one in the clean version. And verify the other dll's as well (so actually verify the entire bin folder - it should be the same exactly apart from the dll's that came from your own code).
If you have dependencies to Sitecore dll's in your solution (Nuget or otherwise), also verify that they refer to the correct version or you might have the same problem again after a deploy.
My pc crashed while my asp.net web application began to run. It did not fully load when this happened. When my pc was restarted, the web application would no longer run. I kept getting 'Could not load file or assembly 'name' or one of its dependencies' for all my packages. First time I got the error for one package so I re-installed it and ran the web application again, then a got the same error with a second package and I did the same. This was a continuous cycle and I could not do this for each package I have installed in the project because there are so many.
I tried many solutions that were posted for a single occurrence of this error such as here, and others but these have not solved my problem.
Does anyone have a solution to this problem? Or know why it has happened?
Sorry my friend... this sounds like corrupted manifest files to me (I recently had the same issue). Unfortunately I could not find an elegant way to fix it, although I do have some tips on how you can fix it (albeit an arduous process):
Make sure all your assembly bindings redirects to the latest versions of all your assemblies. MSDN Article on assembly binding redirect Another MSDN article on assembly binding redirect
Set build output to verbose (In VS2013 > Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity. You then need to evaluate the build output from your Visual Studio output window during build to determine the causes of assembly conflicts within your solution as well as were you might find the conflicting assemblies within your solution.
My PyQt application works fine when running on Linux, when in my Windows build environment, or frozen on the machine where it was build with py2exe. But after moving the frozen executable and its supporting files to another machine it can't load the database driver.
It worked fine when I had Python2.5 and an earlier version of PyQt and py2exe. But after upgrading my toolchain I get these errors:
dbname.open returns false
lastError(dbname) is "Driver not loaded"
I have an sqldrivers folder where I put qsqlite4.dll. This was necessary with the previous build environment, but moving or renaming that DLL doesn't change any behavior. I think that's the DLL that Qt can't find, but I haven't been able to tell Qt where to look.
I am currently running these versions:
python-2.6.3
PyQt-Py2.6-gpl-4.6-1
py2exe-0.6.9.win32-py2.6
Profiling in Dependency Walker gives me this error:
LoadLibraryW("\application\sqldrivers\qsqlite4.dll") returned NULL. Error: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
When I ask Dependency Walker for details about Qsqlite4.dll it says:
Error: The Side-by-Side configuration information for "\application\sqldrivers\QSQLITE4.DLL" contains errors.
That would explain why the DLL won't load, but I'm still unclear how to fix it. Closer inspection shows that error for most of the DLLs I call. Do I need to include a manifest for each Qt DLL I load?
Thanks in advance.
DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far ...
The accepted answer doesn't really say what dlls they copied and in what places. I managed to fix it by copying the driver inside the sqldrivers directory relative to where the exe and qt dlls are (I'm using PySide but should work with PyQt4 as well). In setup.py:
setup(
...,
data_files = [('sqldrivers', ('C:\Python27\Lib\site-packages\PySide\plugins\sqldrivers\qsqlite4.dll',))],
...,
)
I solved it!
I had a really clever way to avoid making my users install vcredist--I copied the manifest and the DLLs into two places and all the errors about the MS DLLs went away. That's when I started trying to figure out this SQLite driver error.
I wasn't as smart as I thought. If I install vcredist all the "Driver Not Loaded" and "No SQL drivers found" errors go away. Arg.
Try to re-install SOLite, or verify if you have putted the DLL in the correct place, because i remember that the MySQL DLL have to be in System32 directory to develop something that uses it.
Regards.