0

I am getting the below Exception but the project has built successfully; but, during Execution, it is not able to pick the required DLL.

could not load a file or assembly "name_cli.dll" or one of its dependencies . the specified module could not be found.

May I know what could be the reason for the Issue?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • 2
    Does this answer your question? [Could not load file or assembly or one of its dependencies](https://stackoverflow.com/questions/4469929/could-not-load-file-or-assembly-or-one-of-its-dependencies) – Vivek Nuna Jun 02 '20 at 10:34
  • 1
    Not all dlls are the same. There are three basic types of dlls 1) Prior to WinXp. These are not compatible with c# and will not run. You need a c++ wrapper to execute these dlls 2) Non Managed from WinXp to present. Need to call using DllImport 3) Managed Dlls and can be referenced directly from c#. These three types also have sub types like X86, AnyCPU, x64. – jdweng Jun 02 '20 at 10:38
  • @jdweng Would you share some url or links to get to know more about the C++ wrapper . I think my issue falls into the 2nd place – Dheena Dayalan Jun 02 '20 at 10:59
  • c++ code can be made to run from managed c#. If you do not have managed c++ then you need to use DllImport. There are lots of examples at www.pinvoke.net. Pinvoke is a site that gives example code of running the Windows dlls (which are c++) from c#. – jdweng Jun 02 '20 at 12:08
  • 1
    @jdweng There is nothing special about DLLs from XP and before. There's really just managed and unmanaged DLLs. – David Heffernan Jun 02 '20 at 12:53
  • @Dheena thus first comment is the key one here, although it rather concentrates on managed DLLs. You'll want to install the appropriate MSVC runtime for this DLL, would be my guess. – David Heffernan Jun 02 '20 at 12:54
  • @DavidHeffernan . Actually , I am using calling cli code from the c# project. cli code should be compatible with the c# right. I still don't see why there is a problem in loading a dll. Add your suggestions please . – Dheena Dayalan Sep 11 '20 at 08:30
  • Why do you ignore the first comment? And the thousands of other questions here that tell you same thing. – David Heffernan Sep 12 '20 at 20:50

0 Answers0