How to know which COM component is called by a cer

2019-06-05 20:21发布

问题:

I got a PIA installed on my box, it is Microsoft.mshtml. If I understandd it correctly, these PIA is provided by Microsoft to ease our life of COM interop. But I want to know which COM component is actually wrapped/called by this PIA. Because I am having a UnauthorizedAccessException, I want to locate the actual COM component and use dcomcnfg.exe to grant it proper permission. I hope this is the right direction.

Thanks!

回答1:

It is c:\windows\system32\mshtml.dll. I seriously doubt that dcomcnfg.exe is going to solve your problem, this is an in-process COM server. You might get more insight by using Sysinternals' ProcMon utility to see exactly which registry or file access is generating the exception. Look for error code 5.

You only need the PIA when you expose types from that COM server in your own public classes. Not that common. PIAs are history with the terrific "Embed Interop Types" option in VS2010. Nicknamed the "no pia" option. You avoid the PIA with Project + Add Reference, Browse tab, select c:\windows\system32\mshtml.tlb. The .dll in earlier versions of Windows.



标签: .net com interop