I have a compiler that targets the .NET runtime (CLR). The current version of the compiler is written in standard C++ (non-managed). The compiler currently lacks support to reference assemblies at compile time, so the way I "import" .NET libraries is with a utility stub generator that is written in .NET, which reflects any assembly and emits a signature stub for it in my custom language. I pre-generate stubs for all the .NET assemblies I use. At compile time, my compiler compiles the stub files to populate the symbol tables, etc. so that it can resolve types and methods from the .NET API. That is my version of "using". This was temporary, however, and now I want to add an actual "using" or "import" directive to the compiler. I need to access the metadata / type info in referenced assemblies at compile time.
My question: I need suggestions on how to access a CLR assembly metadata from non-managed C++. Or, I need justification to convert it to a managed C++ app and use the .NET reflection support. The purpose for pure C++ is that I can also compile on Linux for Mono, plus I also have partial backends for another runtime besides CLR.