C# dll

There are 2 kinds of code, managed (as C#, depends largely on its runtime) and unmanaged (as Rust, C, and C++). Xojo can only use and link to unmanaged code with “C like interfaces”. You could try to experiment C# unmanaged wrappers/exporters as said here:

Or write your DLL in Rust or C directly.