[英]Getting error when try to add a file from library to main project?
I have created a library in c# and add this library to my project but I can't configure how to use the library file to the main project 我已经在c#中创建了一个库并将该库添加到我的项目中,但是我无法配置如何将库文件用于主项目
I have tried the using line 我已经尝试过使用线
using UserManagment.helper;
I am getting the error at UserManagment.helper while my original project is HPS. 我的原始项目是HPS时,我在UserManagment.helper中收到错误。 the error is listed below :
错误在下面列出:
Error 2 The type or namespace name 'UserManagment' could not be found (are you missing a using directive or an assembly reference?) C:\\Users\\Ayesha\\documents\\visual studio 2013\\Projects\\HPS\\HPS\\GUI\\AdminProfile.cs 12 7 HPS
错误2找不到类型或名称空间名称'UserManagment'(您是否缺少using指令或程序集引用?)C:\\ Users \\ Ayesha \\ documents \\ visual studio 2013 \\ Projects \\ HPS \\ HPS \\ GUI \\ AdminProfile。 cs 12 7 HPS
I expect that the UserManagment .helper will successfully be used by the project and declared in my required file 我希望UserManagment .helper将被项目成功使用并在我所需的文件中声明
As discussed in the comments, you need to add the .dll
as a reference to the project then only you will be able to access them in your project. 正如评论中所讨论的,您需要添加
.dll
作为对项目的引用,然后只有您才能在项目中访问它们。
In Solution Explorer, right-click on the References or Dependencies node and choose Add Reference. 在解决方案资源管理器中,右键单击“引用或依赖项”节点,然后选择“添加引用”。 You can also right-click on the project node and select Add > Reference.
您也可以右键单击项目节点,然后选择添加>参考。
Use the browse button to locate the specific .dll
and add the same to the project. 使用浏览按钮找到特定的
.dll
并将其添加到项目中。 Read more about this option here 在此处阅读有关此选项的更多信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.