New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Library Generation for .NET Core COM interop #13374
Comments
@bclothier the current path for the scenario you describe is to use the .NET Framework 4.8 tlbimp to create the PIA. Or if you are using Visual Studio, you can use Embedded Interop Types with this registered tlb. Please let us know if you have any issue with this. |
@jeffschwMSFT you seem to be talking about importing COM types. I'm talking about exporting COM types. In a .NET FX assembly, that would have been done with either the My question deals with the fact that .NET Core no longer uses |
.NET Core also supports .NET COM servers (so the export scenario). If you build a .NET Core COM server, you can register via regsvr32 (similar to native COM). The tlbexp scenario should be possible. What is the scenario you are looking for when using the tlb? |
I'm primarily interested in knowing whether it's safe to write a IDL file and compile the type library from the |
It is our expectation that this scenario should work, but there are complications and rough edges. The .NET Framework tlbexp loads the assembly and will produce the tlb. For the actual COM interface, this should be just fine. But you can imagine there are features/types introduced in .NET Core that .NET Framework may not be able to load. |
@bclothier as @jeffschwMSFT says, tlbexp will have some rough edges. However, manually writing an IDL file to describe COM types in your .NET Core DLL should work as long as it is accurate. |
Thanks! That's a great news. Just as a FYI - we currently use a IDL file for our project to work around some limitations in the .NET FX's attributes, mainly the inability to mark types as |
I am keen to learn how to create a TLB file. Is there any step by step guide? I asked also here |
At the present, .NET Core does not support type library generation. However, we still can generate an arbitrary type library from an IDL file and compiling with MIDL. Would there be issues with using such .tlb file generated this way to describe a .NET Core DLL containing the COM types, assuming of course the description is correct?
The text was updated successfully, but these errors were encountered: