Visual Studio上点击启动项目时出现“A project with an output type of class library cannot be started directly”错误,这是因为VS工具不知道启动项目是哪一个,具体错误内容全文如下:
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.
如图所示:
错误解决方案:
在项目上点击右键,选择“Set as StartUp Project” 选项(中文意思为:作为启动项目),然后点击VS工具中的“start”按钮重新运行项目即可。