如何在另一个项目中引用dll的方法 [英] How use method from dll referenced in another project

查看:267
本文介绍了如何在另一个项目中引用dll的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dll,这个dll在一个项目中被引用。

我有第二个项目,需要使用该dll中的一些方法



如何调用那些仅引用具有dll的项目的方法?

Hi, I have a dll, this dll is referenced in a project.
I have a second project that needs use some methods from that dll

How can I call those methods only referencing the project that has the dll ?

推荐答案

直接向新项目添加对DLL的引用:open您在VS中的项目,在解决方案资源管理器中展开项目分支,然后右键单击参考。

从上下文菜单中选择添加参考...并等待对话框 - 如果可以花一点时间才能出现。

您现在可以使用对话框左侧的项目选项卡,也可以使用浏览键找到DLL文件。按添加和关闭以添加您的参考。
Add a reference to the DLL directly to your new project: open your project in VS, expand the Project branch in the Solution explorer, then right click "References".
From the context menu, select "Add Reference..." and wait for the dialog - If can take a little while to appear.
You can now either use the "Projects" tab on the left hand side of the dialog or use the Browse key to locate the DLL file. Press "Add" and the "Close" to add your reference.


这根本没有意义。为什么? (为什么?!)如果你只需要引用引用DLL的程序集(你不是引用DLL,你只引用程序集; DLL是程序集的可执行模块,可能还有其他模块),你需要使用引用的程序集再次重新实现相关方法。但为什么要烦心呢?



无论如何,我解释了你的方式;现在你决定。



-SA
It simply makes no sense. Why? (Why?!) If you need to reference only the assembly referencing the DLL (you are not "referencing" DLLs, you reference only assemblies; a DLL is the executable module of the assembly, there could be other modules), you need to reimplement methods in question again, using the referenced assembly. But why bothering?

Anyway, I explained you the way; now you decide.

—SA


这篇关于如何在另一个项目中引用dll的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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