System.IO.FileNotFoundException

Hi,

I have converted the C# Sample project to Visual Studio 2019. When I run the project I get the following error. Any idea?

System.IO.FileNotFoundException: 'Could not load file or assembly 'OCCTProxy.dll' or one of its dependencies. The specified module could not be found.'

Regards,
Hari

Jindrich Nikodem's picture

I have a same problem. :-(

Jindrich Nikodem's picture

I tried find all dependencies libs for OCCTProxy.dll via dumpbin /dependents.

I have all dlls in the root folder of my application, but still I have error message Could not load file or assembly 'OCCTProxy.dll

Windows 10 Pro - 20H2, Visual Studio 2019 Community

Please, do have anybody some idea?

Here is dumpbin /dependents result:

MSVCP140D.dll
TKernel.dll
TKBRep.dll
TKXSBase.dll
TKService.dll
VCRUNTIME140D.dll
ucrtbased.dll
KERNEL32.dll
TKV3d.dll
TKOpenGl.dll
TKIGES.dll
TKVRML.dll
TKMath.dll
TKSTEP.dll
TKSTL.dll
TKLCAF.dll
mscoree.dll

Kirill Gavrilov's picture

Your list of dependencies looks incomplete (no freetype, for example) - probably the search has been done without recursion.

Jindrich Nikodem's picture

Thanks for your answer. I tried copy all DLLs from \OpenCASCADE-7.5.0-vc14-64\opencascade-7.5.0\win64\vc14\bin\ to my root application folder.
But result is same. Still I have same error .

Please, where can I find, list of dependecy DLLs for OCCTProxy?

I am testing WinForn C# original sample from OpenCASCADE-7.5.0-vc14-64\opencascade-7.5.0\samples\CSharp\

Thanks.

Kirill Gavrilov's picture

"OpenCASCADE-7.5.0-vc14-64\opencascade-7.5.0\win64\vc14\bin" contains only OCCT libraries, but OCCT itself depends on several other projects, which are placed in other folders. These are normally added to %PATH% variable by env.bat batch script, or should be copied to application folder.

Dependency Walker shows all dependencies - just need to check them recursively. The simplest way is, however, just starting a normal C++ application - system will show error with information about missing DLLs. Unfortunately, C# loader of DLLs is less verbose and leave user with unclear errors.

You may try putting CheckDLL64 to the place, where you've copied all DLLs to see which might be missing.

Dmitrii's picture

I had a problem like Hari Nidamarthy and Jindrich Nikodem. But CheckDLL64 showed me which DLL are lost. I added all DLL to the environment variable 'Path'. Everything works, thank you!

I added to the 'Path':
C:\OpenCASCADE-7.5.0-vc14-64\opencascade-7.5.0\win64\vc14\bin
C:\OpenCASCADE-7.5.0-vc14-64\vtk-6.1.0-vc14-64\bin
C:\OpenCASCADE-7.5.0-vc14-64\tcltk-86-64\bin
C:\OpenCASCADE-7.5.0-vc14-64\tbb_2017.0.100\bin\intel64\vc14
C:\OpenCASCADE-7.5.0-vc14-64\openvr-1.14.15-64\bin\win64
C:\OpenCASCADE-7.5.0-vc14-64\freetype-2.5.5-vc14-64\bin
C:\OpenCASCADE-7.5.0-vc14-64\freeimage-3.17.0-vc14-64\bin
C:\OpenCASCADE-7.5.0-vc14-64\ffmpeg-3.3.4-64\bin
C:\OpenCASCADE-7.5.0-vc14-64\qt5.11.2-vc14-64\bin

Dmitrii's picture
清的 涨's picture

The Simplest solution is : search .dll files in the opencascade folder , and then copy all dll files into the folder where you progress runs.