The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)

6

My C++ DLL (called from C# application) works fine with Debug version (main C# app in Debug ) but release version(main C# app in Release) gives The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)] System.DllNotFoundException: Unable to load DLL 'D:\TestBluRay.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F) error. I've verified all project settings and those appear to be same for both debug and release. Any idea why this fails for release version only?

c#
c++
dll
dllimport
asked on Stack Overflow Apr 28, 2016 by codematrix • edited May 5, 2016 by codematrix

1 Answer

0

Validate that the .DLL is present, and fully up-to-date between both \bin\debug (which works), and \bin\release (which is failing).

Most likely, the .DLL needs either recompiling, or simply copying in if it's a 3rd-party library.

EDIT: Your error indicates that the file may be missing entirely (DllNotFoundException), or that you're referencing a path/directory, instead of a fully qualified path name. "\Drivers\Blu_ray.." isn't a fully-qualified path name, where "C:\Windows\System32\Drivers\Blu_ray.." etc., would be a fully qualified path name.

My guess is that \bin\release\ doesn't have \drivers\blu_ray, whereas \bin\debug\ probably does have \drivers\blu_ray...

answered on Stack Overflow Apr 28, 2016 by gravity

User contributions licensed under CC BY-SA 3.0