Given that the code works for us and for other customers, that must be something specific to your project. Can you please check and tell us whether your project is configured to run in some restricted way?

Another possible reason is that you link .NET 2.0 assemblies to .NET 4.x project. You need to ensure that correct assemblies are loaded (we provide separate assembly set for each version of .NET Framework).

This is your provided project, not my code. The only change I made was to change the PlatformTarget in Visual Studio from AnyCPU to x86, as the PKCS#11 library that we use is 32-bit (and otherwise you get the message about incompatible formats when trying to load the DLL).

So I have not linked any assembles, they have already been done in your project. I can see that the correct .Net 4 assembles were selected.

Unfortunately it doesn't seem to be possible to reproduce the issue in real-life conditions (we tried). We will add the extra safety measures (security attributes) in a couple of places and I hope that those additions would address the problem. The change will go to the next build, which will happen in about two weeks.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.