无法从一个 class 库引用另一个

Unable to reference one class library from another

我在 C# 中有一个关于 OOP 的作业,涉及我创建一个基础 class(以 class 库的形式)和派生的 class(作为另一个 class 库)。我意识到要使两者正常运行,我需要在派生的 class 中引用基础 class' .dll。但是,我无法为基础 class 生成该 .dll 文件,因为我收到错误 "A project with an Output type of Class Library cannot be started directly"。我的教科书说解决这个问题的方法是在 VS 2013 中单击 "Build Solution",这应该可以使其运行。我已经这样做了,但是 mien 仍然不起作用。我哪里错了?

"A project with an Output type of Class Library cannot be started directly"

这意味着您正在尝试 运行 将项目标记为库,而不仅仅是构建它。只需编译此项目而不尝试 运行 它,然后创建另一个 运行 可用的项目(例如控制台应用程序、win 表单应用程序等)并从该新项目中引用您当前的解决方案。

或者,将当前项目的类型更改为运行可用的类型。