Unable to make a tutorial run

hi!
iam trying to make a tutorial run, but i got some errors.
i followed the instructions provided here:
https://www.stereolabs.com/docs/app-development/csharp/use/
i succeded in all the steps, but whem i make the code run, i get an exception on this line:
ERROR_CODE err = zedCamera.Open(ref init_params);
‘Unable to load DLL ‘sl_zed_c.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)’

the sl_zed_c.dll is in either output directory, and in sdk directory.

so i tried to start a new c# project (.net framework 4.6.1) and install the nuget package stereolabs.zed (3.6.0) but also i got an error during the installation process: “failed to add reference to ‘sl_zed_c’. please make sure that the file is accessible, and that it is in a valid assembly or com component”.

there is no way to make it works.

then i decided to build the cpp version, and make my own c# wrapper, but i got this at launch:
“nvEncodeAPI64.dll was not found”.

what am i doing wrong?
i’ll appreciate any suggestion.

1 Like

Hi,

It seems that the nuget package can not be correctly imported in visual studio (it works fine using cmakelist).

Can you try to use the package added in attachement. You can use local nuget package by following this tutorial : Creating and using a local NuGet package repository | by Vibhav Churi | Medium

Best regards,
Benjamin V

Stereolabs.zed.3.6.0.nupkg (77.7 KB)

ty for the reply,
i succeded installing the nuget package localy in my project without any error, but now i got the same error as the cmakelist example “hello zed”:

ERROR_CODE err = zedCamera.Open(ref init_params);

‘Unable to load DLL ‘sl_zed_c.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)’

when i build my project, files “sl_zed_c.dll” and “Stereolabs.zed.dll” are correctly copied in the output folder, but the error persist.

any other suggestions?

Can you verify the platform target of your project is x64 ?

hi,
hello_zed tutorial has x64 for default, i checked my project: it has x64 too.
i get the same error on both projects.

Could you run the ZED Diag tool and share it by mail at support@stereolabs.com ?

Best,
Benjamin V

i sent via mail some video of tests done with diag tools, but i was unable to complete them.

Is there any progress on this issue?
I have the same problem but I did more tests and when I tried to load sl_zed_c.dll using LoadLibrary() I got Windows Runtime error: The procedure entry point ?pauseObjectDetection@Camera@sl@@QEAAX_NI@Z could not be located in the dynamic link library sl_zed_c.dll, which in turn was displayed by the program as: System.DllNotFoundException: ‘Unable to load DLL ‘sl_zed_c.dll’: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)’.
Maybe this will help.

Hi,

Can you make sure the ZED SDK and the nugget package you are using have compatible versions?

My guess is you are using the ZED SDK 3.8 with the 4.0.x nuget package.
If so, please either use the v3.8 version of the nuget package or the ZED SDK v4.0.2.

Yes, you are right. I downgraded the nuget package to version 3.8 and everything works now. Thanks and sorry for the inconvenience.

I am having the same problem. I can only download and installed ZED SDK 4.0.2 while the latest nuget package from stereolabs.zed is 4.0.1. I can c-make and run the C++ Version without problem. But for every project i try to run in C# I get

System.DllNotFoundException: ‘Unable to load DLL ‘sl_zed_c.dll’: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)’

raised by stereolabs.dll

I fixed it by manually building it. The nuget packages do not work! Had to manually copy the built sl_zed_c.dll into the execution folder: GitHub - stereolabs/zed-csharp-api: C# API for the ZED SDK

1 Like

Thanks @aicode this worked now. Had to build the GitHub - stereolabs/zed-c-api using CMake to get the sl_zed_c.dll. All tutorials work now.

@Stereolabs, can you release a new version of nuget which works with the tutorials??