"Frame not in module" error in C++/CLI

I’ve been developing a C++ plugin, and I now need to use a C# library. I turned /cli compiler option to use C++/CLI, and I got “Frame not in module” error when the plugin was loaded. I also get the same error with the bare plugin template just with /cli option turned on. Does anyone know how to fix this problem?

I’m using Visual Studio 2017 ver.15.9.51, Rhino 6

Thank you

“Frame not in module” error usually occurs when the debugger is unable to find the correct symbol information for a frame in the call stack. There could be multiple issues, check for : mismatched debug information, missing symbol files, or incorrect platform architecture.

@farouk.serragedine, thank you for your suggestion. I also thought it is related to the debugger, so I tried release build but it resulted the same.
I look into debug info, symbol files and platform architecture as you suggested. In the meantime, some additional info or suggestions of any specific places/files/settings to check would be very much appreciated.
Thank you