VB脚本代码未调用C#函数 [英] VB Script code not calling c# function

查看:59
本文介绍了VB脚本代码未调用C#函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个C#dll并注册为Com对象。 (使用ProgID,设置Comvisible True并使用Strong Name签名程序集。)

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

我正在尝试使用以下vbscript代码调用c#方法

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?

以下是我注册的dll的注册表信息。

The below is the registry informaton of my registered dll.

推荐答案

确保已将C#程序集的ComVisible设置为True

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.

这篇关于VB脚本代码未调用C#函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆