.Net to COM Interop Tester

五迷三道 提交于 2019-12-11 06:31:33

问题


I made a class in C# that I am exposing to COM. I can register it just fine using RegAsm.exe.

I would like to test it before I send it off, but using TlbImp.exe gives me an error of "Type libaray was exported from a CLR assembly and cannot be re-imported as a CLR assemply."

What is a good way to test this?


回答1:


You can create a VB macros in word\excel\etc:

Dim obj As Object
Set obj = CreateObject("progid here")
Call obj.SomeMethodForTest()



回答2:


Use PowerShell:

$myObj = new-object -comObject ProgId


来源:https://stackoverflow.com/questions/2932183/net-to-com-interop-tester

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!