C# how to use reflection to call interface of COM

RX 1 Reputation point
2020-08-07T06:24:49.993+00:00

Dear all,

I want to use reflection to call a COM lib in C#.
I can't load the .dll file because the .dll files differ on different computers.
I tried to use AppDomain.CurrentDomain.GetAssemblies() to get all assemblies which the program loads, but among the returned assemblies I can’t find the library but a “Anonymously Hosted DynamicMethods Assembly”.
So do you know how to load a COM assembly?

Thanks!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,709 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Richard Zhang-MSFT 6,936 Reputation points
    2020-08-10T08:08:16.617+00:00

    Hello,

    Welcome to Microsoft Q&A.

    Your question is related to the C# language, and the topic Q&A is temporarily not supported.

    You can ask questions on the MSDN Forum, where the engineers are actively answering related questions.

    Thanks.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.