输出类型为类库的项目无法直接启动ERROR

时间:2014-12-22 17:25:50

标签: c# winforms visual-studio-2012

当我为我的项目“垄断”完成面向对象的设计时,我在板上实现了一些简单的按钮(正如你在后台可以看到的那样)并为它们做了一个简单的功能,只是为了测试我的项目是如何进行的。 .anyway我无法运行我的项目,它向我显示此错误消息 我尝试将该集作为我的项目的启动项目方法,但它没有工作...... 任何帮助PLZ? enter image description here 无法直接启动具有类库输出类型的项目。要调试此项目,请将可执行项目添加到此解决方案中,该项目引用库项目。将可执行项目设置为启动项目。

 A project with an output type of class library cannot be started directly.In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project.

1 个答案:

答案 0 :(得分:11)

您意外地将项目创建为类库而不是Windows应用程序。纠正:

  1. 右键单击右侧 Solution Explorer 中的项目
  2. 点击属性
  3. 选择应用程序标签(应该是最重要的)
  4. 将输出类型更改为 Windows应用程序
  5. 保存
  6. 尝试再次编译