rsid_dotnet.dll is not loaded in C# WPF application
We are trying to run the sample C# based WPF application from RealSense ID SDK and almost fixed all the bugs cropped while making the application running. But after several attempts the application is unable to load rsid_dotnet.dll library properly and throwing the error given below:
System.Windows.Markup.XamlParseException: 'Could not load file or assembly 'rsid_dotnet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.'
Inner Exception:
BadImageFormatException: Could not load file or assembly 'rsid_dotnet, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Request you to help us to resolve this in order to run the sample application successfully. This will provide us clear vision to use the APIs properly in our custom developed software.
Thanks,
Revathi.
-
Official comment
Hello Revathi,
If you are using the pre-built RealSenseID SDK binary, then you should find rsid_dotnet.dll in the same directory as rsid-csharp-example.exe, C:\Program Files\Intel RealSenseID SDK\examples.
If you are building the examples from source, then the rsid_dotnet.dll project should get loaded within your RealSenseID_CSharp_Sample solution as shown in the screenshots below. The rsid_dotnet project builds the rsid_dotnet.dll file in the same directory as the rsid-csharp-sample executable. If you are compiling in Release mode then the file is rsid_donet.dll, and if compiling in Debug mode it is rsid_dotnet_debug.dll.
1. Use CMake to generate the Visual Studio solution and project files and ensure you select RSID_SAMPLES.
2. After you generate the projects, you will find the csharp Visual Studio solution under the RealSenseID/build/samples/csharp directory.
3. Open RealSenseID_CSharp_Sample.sln and you will find the wrappers/rsid_dotnet project, which builds rsid_dotnet.dll.
Comment actions -
The above steps are followed to generate the rsid-csharp-sample.exe file. After run the executable file does not open the application.
error:
"C:\Users\EPRM_R16\Desktop\RealSenseID-master\build1\bin\Debug>rsid-csharp-sample.exe
[2021-04-20 15:13:00.008] [debug] [WindowsSerial] Opening serial port COM9
[2021-04-20 15:13:00.009] [error] [FaceAuthenticatorImpl] Failed to open serial port. GetLastError: 2
Error connecting to device:
[2021-04-20 15:13:00.011] [debug] [NonSecureSession] Start session
[2021-04-20 15:13:00.011] [error] [FaceAuthenticatorImpl] NonSecureSession: serial connection is null
OnResults Failure
[2021-04-20 15:13:00.013] [debug] [NonSecureSession] Close session".Request you to help us to resolve this problem
-
Hello Revathi,
Specify the COM port that the F455 is connected to. According to these instructions:
"Run Windows "Device Manager" and check in which COM port the device was recognized (It should appear under Ports (COM & LPT) (For example: COM3)"
The F455 appears as "USB Serial Device (COM#)" in Device Manager under Ports (COM & LPT).
Update line 31 of Program.cs with the correct COM port number.
You will have to make a similar change if you run the other sample programs.
Sincerely,
Jesus G.
Intel Customer Support -
The above steps were followed to run the rsid-viewer.exe in command prompt. After opening the executable file, the camera preview is not running.
Then we ran the rsid-cli.exe COM4. It is opening the serial port and connected to device. further we are getting the following error.
[2021-04-21 11:52:54.577] [error] [SecureSession] Verify key callback failed
[2021-04-21 11:52:54.579] [error] [FaceAuthenticatorImpl] Session start failed with status 106
Status: SerialSecurityErrorRequest you to help us to resolve this problem at the earliest.
-
Hai Jesus Garcia,
This instructions are followed to make the build folder. After run the rsid-viewer.exe
The camera preview is not running in my example application. How to solve this problem as soon as possible.
Please sign in to leave a comment.
Comments
7 comments