VB.net中的Comclass参考 [英] Comclass reference in VB.net

查看:313
本文介绍了VB.net中的Comclass参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在vb.net中创建了一个comclass,而该类正在被vb6应用程序调用. comclass需要引用一个外部.dll.一切都可以在我的机器上正常运行,但是在部署到Dev服务器时出现错误,提示它无法引用外部.dll.我的问题是,Comclass是否有可能拥有自己的引用,如果可以的话,如何在Dev中使用该引用?我尝试了组件服务并使用regserv32,但它们无法识别.dll.

谢谢你们的答复.我尝试引用的.dll是第三方的.我可以从同一服务器上的另一个vb.net项目访问它.我在ComClass中以完全相同的方式添加了对它的引用,但是却收到此错误
无法加载文件或程序集" ConnectorCaller,版本= 0.0.0.0,区域性=中性,PublicKeyToken =空"或其依赖项之一.系统找不到指定的文件"
正如我在组件服务和regserv32之前所说的那样,它无法识别.dll.

I have created a comclass in vb.net which is being called by a vb6 app. The comclass needs to reference an external .dll. All works well on my machine but I get an error when deployed to the Dev server saying that it cannot reference the external .dll. My question is, is it possible for a Comclass to have its own references and if so how do I make that reference available in Dev? I have tried component services and using regserv32 but they don''t recognise the .dll.

Thank you both for your replies. The .dll I am trying to reference is a third party one. I have no problem accessing it from another vb.net project on the same server. I have added the reference to it in exactly the same way in the ComClass but am getting this error
"Could not load file or assembly ''ConnectorCaller, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'' or one of its dependencies. The system cannot find the file specified"
As I said before component services and regserv32 don''t recognise the .dll.

推荐答案

AFAIK,您应该可以添加引用,并且应该可以与在Visual Studio中添加普通引用的方法相同.

如果您在
AFAIK, you should be able to add a reference and it should be possible in the same way as adding a normal reference in Visual Studio.

If you observe, in this[^] tutorial, a reference is used.


如果您的库引用的.DLL是基于COM的.DLL,那么您需要在项目中添加对其的引用并进行编译.既然您已经编译了项目,那么您将已经完成了.

如果它是标准库.DLL,则只需将其放在运行主机.EXE的文件夹中(而不是您的库.DLL)中,或者放在PATH环境变量中列出的文件夹中.
If the .DLL your library is referencing is a COM-based .DLL, then you would need to add a reference to it in your project and compile it. Since you''ve already compiled your project, you would have done this already.

If it''s a standard library .DLL, then it just needs to be in either the folder that the host .EXE is running from (NOT your library .DLL) or in a folder listed in the PATH environment variable.


这篇关于VB.net中的Comclass参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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