Sharp Objects
Step 10 - Sharp Objects So someone asked, can you dynamically load the library in csharp just like python? Hmm. Probably.... That would be nice, and I'm pretty sure we can do a lot of manipulation on the go with C#, like we can in python, there's a comprehensive reflection and invocation interface. How hard can it be? Can we build a c# interface on the fly instead of outputting source code to be compiled? so, significant rummaging later and the answer is a definite "sort of". 👍😁 Emit emit emit Initially, I used Reflection.Emit to generate CLR code at runtime... this worked and provided a fully dynamic binding doing the same as Python, loading the C++ library, calling our C API to interrogate it and building matching C# CLR objects at runtime. yay great success, move on.... but, developing with it is "challenging" you need to know all the available functions and types, write all the code wire up a command line build and crank the handle. So poss...