简体   繁体   English

添加对C#的引用

[英]Adding reference to c#

In my application i want use CAVEditLib.dll reference.But i can't find the library in COM reference.I am getting error as "Error 1 The type or namespace name 'CAVEditLib' could not be found (are you missing a using directive or an assembly reference?)" 在我的应用程序中,我想使用CAVEditLib.dll引用。但是我在COM引用中找不到该库。我收到错误消息,提示为“错误1找不到类型或名称空间名称'CAVEditLib'(您是否缺少using指令?或装配参考?)”

What may the problem? 可能是什么问题?

尝试将CAVEditLib.dll放在解决方案所在的lib文件夹中,然后使用“浏览”并添加来自实际文件的引用,而不是添加COM引用。

Have you tried to register your library? 您是否尝试过注册图书馆? Go to the command prompt, cd to the folder where your library is located and execute "regsvr32 /i CAVEditLib.dll". 转到命令提示符,cd到库所在的文件夹,然后执行“ regsvr32 / i CAVEditLib.dll”。 This should work 这应该工作

Put your CAVEditLit.dll in the debug folder of your project. 将您的CAVEditLit.dll放在您的项目的debug文件夹中。

One more thing you can do is.. In Visual Studio Menu 您可以做的另一件事是..在Visual Studio菜单中


Project

Add Reference

and then in the new dialog click on the Browse tab and select your dll. 然后在新对话框中,单击“浏览”选项卡并选择您的dll。

This will help you. 这将为您提供帮助。

To use an external library in your code you need to: 要在代码中使用外部库,您需要:

  1. Add a reference to it. 添加对其的引用。

  2. Add a using in the code file where you are using the library. 在使用库的代码文件中添加一个using。

    using CAVEditLib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM