I have a WPF application in C# 8 on .NET 4.8 on the latest version of windows 10 in VS 2019. It prints & writes mifare cards on a zebra ZC 350 printer via the link OS SDK of zebra.
It works fine when run inside Visual studio (in debug mode) but when I run the standalone exe it crashes when the application tries to write the mifare tag/chip via the winscard dll (C# calls win32/winscard.dll native code). It crashes with an AccessViolationException. Normally you would think there is a pointer bug in the native code of winscard.dll but it works inside Visual studio...
I don't know how to solve this. Googling did not provide any answers. Anybody ever experienced the same thing or something similar? What's the solution?
Thanks!