Difficulty packaging working C# code as DLL

I have some C# code that works fine as a collection of script assets, but when I try to package everything except a simple calling function out into a separate dll in the assets folder, the same call that used to work fine goes into an unbreakable infinite loop (CPU pinned at 100%).

From experience, this behavior often means that there is some low-level error in Unity (perhaps due to library version skew), but it is very hard to debug, since the code works fine in the debugger!

Btw, I compiled the dll in a standalone copy of MonoDevelop and carefully checked that all the package references (and versions) and other options are the same as in the MonoDevelop instance that is automatically spawned from Unity. I even tried using the dll that is created in the project’s Temp/bin/Debug/ folder (same looping behavior).

Has anyone had a similar experience, and if so, how did you solve it? This is driving me crazy.

Tx, -Chuck

Ok, after a lot of experimentation, I found that the only way I can get my dll to not go into a tight loop is to have the MonoDevelop compiler emit debbging information (.mdb file) and put that in the assets along with the dll. I guess this is fine, but why is this necessary??? Other projects seem to be able to use just plain dll’s and there is no mention of this issue in Unity documentation.

Any insights would be welcome!

Tx, -Chuck