如何在.net项目中添加引用

发布于 2025-01-11 20:43:34 字数 333 浏览 2 评论 0原文

我有一个下面提到的简单项目。 有人可以告诉我如何在 classLibrary2 中引用我的 classLibrary1,我右键单击并尝试添加引用,但这不起作用,因为我无法在 classLibrary1 中使用 classLibrary2 的方法(我继承了 classLibrary2 中的 classLibrary1 的类以及)

为什么我看不到 classLibrary1 和 classLibrary2 中的 References 文件夹?

项目屏幕截图

请帮助

I have a simple project mentioned below.
Can somebody tell me how can I reference my classLibrary1 in classLibrary2, I right-clicked and tried adding reference but that isn't working since I am not able to use the method of classLibrary2 in classLibrary1 (I am inheriting the class of classLibrary1 in classLibrary2 as well)

Why am I not able to see the References folder in classLibrary1 and classLibrary2?

projectscreen shot

PLease help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慢慢从新开始 2025-01-18 20:43:34

你看不到参考文件的原因是因为你创建了一个类库。
输入图片此处描述
输入图片这里的描述

我们可以看到,类库(.Net Framework)有一个References文件,但类库没有。

您可以右键单击该项目并选择“添加”->“引用”以添加引用,将项目包含在解决方案资源管理器中。
输入图片此处描述
输入图片此处描述

The reason why you can't see the reference file is because you created a Class Library.
enter image description here
enter image description here

As we can see, the Class Library (.Net Framework) has a References file, but the Class Library does not.

You can right-click on the project and choose Add->Reference to add a reference include the projects in the solution explorer.
enter image description here
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文