尝试将文件从库添加到主项目时出错?

Getting error when try to add a file from library to main project?

我已经在 C# 中创建了一个库,并将这个库添加到我的项目中,但是我无法配置如何在主项目中使用该库文件

我试过使用线

using UserManagment.helper;

我在 UserManagment.helper 处收到错误,而我的原始项目是 HPS。 下面列出了错误:

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

我希望 UserManagment .helper 能被项目成功使用并在我需要的文件中声明

如评论中所述,您需要添加 .dll 作为对项目的引用,然后只有您才能在项目中访问它们。

在解决方案资源管理器中,右键单击“引用”或“依赖项”节点并选择“添加引用”。您也可以右键单击项目节点并 select 添加 > 引用。

使用浏览按钮找到特定的 .dll 并将其添加到项目中。详细了解此选项 here