I am currently using a COM Interop DLL, generated with tlbimp, to access a proprietary COM library from C# (net8), so no source code available (TLB embedded in DLL). It works, but stops me from using Trimming and AoT.
Now, I stumbled over the new ComWrapper API and its Source Generator, but can't find any resources explaining how to switch from the built-in COM Interop mechanism to the ComWrapper Source Generator with only a TLB/Interop Assembly available.
From my understanding, it should be somehow possible to generate C# classes from a COM library that make use of the new ComWrapper API and Source Generator. Similar to tlbimp but with code as a result instead of a binary.
I was thinking about disassembling the COM Interop to get the C# source and manually convert it to use the new ComWrapper API (related Q&A), but this seems like a lengthy and broken approach, especially for COM libaries with an excessive API.
What am I missing?
By the way: can I expect any performance improvements by using the ComWrapper API over the current COM Interop, or is it only about debugging, trimming and AoT?
tlbimpis the compiled result of what's needed as a base to use the new ComWrapper API. I found this post that followed my mentioned workaround of disassembling the Interop.dll, but only for a very tiny task, my COM library is huge, and without automation this is unfeasible. So what am I missing? Is there just no tool yet? If it is impossible, why does the workaround work?