[英]Calling .Net Class Library (dll) from VB
I've used a tutorial ( http://support.microsoft.com/kb/317535 ) to create a VB.NET Class that exports a COM visible method for calculating MD5 checksums. 我使用了一个教程( http://support.microsoft.com/kb/317535 )创建一个VB.NET类,该类导出一个COM可见方法来计算MD5校验和。
The problem is that I need to call this .dll from a language similar to VB (Extra Basic) and it only supports COM calls. 问题是我需要从类似于VB(额外基本版)的语言调用此.dll,并且它仅支持COM调用。 On my machine everything works like a charm, but on the destination server it doesn't work at all.
在我的机器上,所有内容都像超级按钮一样工作,但在目标服务器上却根本不起作用。 I get "Object creation failed" from the "VB like" application.
我从“ VB类”应用程序中获得“对象创建失败”。
According to the tutorial the only thing one need to do is to use regasm to register the .dll. 根据教程,唯一要做的就是使用regasm注册.dll。 This doesn't work.
这行不通。 I have obviously made something wrong when I registered the .dll.
当我注册.dll时,我显然做错了。
What do VS2005 do to make this .dll visible for COM calls? VS2005做什么使该.dll对于COM调用可见?
I have tried to uese regsvr32, but it faild to register the .dll with the following message: "xxx.dll was loaded, but the DllRegisterServer entry point was not found. This file can not be registered" 我尝试使用regsvr32,但无法使用以下消息注册.dll:“已加载xxx.dll,但未找到DllRegisterServer入口点。无法注册此文件”
Best regards Ausgar 最好的问候奥斯加尔
You can't use Regsvr32.exe, Regasm.exe is required. 您不能使用Regsvr32.exe,需要Regasm.exe。 You must either run it with the /codebase command line argument or install the assembly in the GAC.
您必须使用/ codebase命令行参数运行它,或在GAC中安装程序集。 I assume that's your problem.
我认为那是你的问题。
These kind of registration issues are always fugly, not in the least because they require an install program instead of Xcopy.exe. 这些注册问题总是很丑陋,至少不是因为它们需要安装程序而不是Xcopy.exe。 And invoke DLL Hell if you don't version correctly.
如果版本不正确,则调用DLL Hell。 Which you won't if you don't use the GAC.
如果您不使用GAC,则不会。 Consider using a manifest instead that contains the <clrClass> element.
考虑使用包含<clrClass>元素的清单来代替。 Take the first Google hit.
抢先击中Google。
It sounds like you don't have all the items that your application requires installed or working on the server. 听起来您没有在服务器上安装或运行应用程序所需的所有项目。 Some things to look at are:
需要注意的一些事情是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.