I have an SDK provided by a biometric device manufacturer. That SDK contains a lot of DLL's whose main DLL, the one that is added as a reference to the project, is called zkemkeeper.dll.
The manufacturer provides also a Visual Studio project as a demo for the SDK usage. That Demo works.
I have created a new Visual Studio project. Added the same reference to zkemkeeper.dll but some methods don't work, throwing an exception Attempt to read or write to protected memory. This often indicates that there is other memory corruption.
First, please see the reference added in both projects:
When seeing the properties of the added reference for the working project, this is shown:
However, please see the properties for the same reference but in the non-working project:
Look at the line whose label is "Incrustar tipos de interoperatividad" ("Embed interop types"). That line is missing in the working project (the one provided by the manufacturer).
Furthermore, in both project there is this class property:
public zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
By browsing the zkemkeeper.CZKEMClass definition, I see this in the working project:
However, this is in the non-working project:
See that it is a little different also.
Can you explain me what is going on here? Did I miss to set something in the Visual Studio project? This is in Visual Studio 2022, but the same happens in earlier versions.
Another thing to note. File Interop.zkemkeeper.dll is not generated in my project, but it was in the manufacturer demo project. One attempt was to copy this file to my project but no avail.




