VBScript code not calling c# function

2019-07-18 07:20发布

I have created a C# dll and registerd as Com object. (Used ProgID, Set Comvisible True and Sign the assembly using Strong name).

I am trying to call c# method using the below vbscript code

Option Explicit 
Dim testwfhandler 
Set testwfhandler= CreateObject("CoreComponentWorkflow.WorkflowHandler") 
If Not testwfhandler Is Nothing Then     
Call testwfhandler.test()     
End If 
Set testwfhandler= Nothing 

am i missing anything? or am doing anything wrong?

The below is the registry informaton of my registered dll.

enter image description here

1条回答
Animai°情兽
2楼-- · 2019-07-18 07:56

Make sure you have set ComVisible to True for the C# assembly

Register the assembly using:

regasm /codebase YourAssembly.dll

Then call it as you have above.

查看更多
登录 后发表回答