具有类库输出类型的项目无法直接启动-使用启动exe [英] A project with output type of class library cannot be started directly - with a startup exe

查看:98
本文介绍了具有类库输出类型的项目无法直接启动-使用启动exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我完全了解此消息及其正常发生的原因.这并不是说我只是在尝试运行dll(例如此问题).

Firstly I'm completely aware of this message and why it happens normally. It's not that I'm just trying to run a dll (like this question).

我有一个可以编译为dll的项目,但是在项目属性中指定了启动程序.大多数时候,我可以右键单击该项目,然后选择调试">启动新实例",它将运行该程序并让我调试我的dll.但是,有时会收到此消息(无法直接启动具有类库输出类型的项目),好像没有启动程序一样.头几次,我以为只是我无意中点击了错误的项目,但我确信事实并非如此,因为它已经发生了很多次,所以我一直很小心地观看它.

I have a project that compiles to a dll but has a startup program specified in the project properties. Most of the time I'm able to right-click on the project and select Debug > Start new instance, and it will run the program and let me debug my dll. However, occasionally I get this message (A project with output type of class library cannot be started directly) as if I haven't got a startup program. The first few times I thought it was just me accidentally clicking on the wrong project but I'm certain this isn't the case given that it's happened so many times and I've been careful to watch it.

出现此消息后,我可以再次尝试,并且始终可以进行第二次或第三次尝试.

When this message appears I'm able to try it again and it always works on the second or third attempt.

使用相同解决方案的同事永远不会出现此问题:-/

A colleague using the same Solution never has this problem :-/

还有其他人有这个问题,或者知道如何解决吗?

Anyone else had this problem or know how to solve it?

我正在使用Visual Studio 2005 Pro版本8.0.50727.762(SP.050727-7600) 编辑:Visual Studio 2010也是如此

I'm using Visual Studio 2005 Pro Version 8.0.50727.762 (SP.050727-7600) Edit: Also happens with Visual Studio 2010

推荐答案

另一位同事建议,这是因为在单击调试">启动新实例"后,在等待其启动时,我单击了另一个项目.我出于任何原因都不会这样做,只是在等待项目启动时随机选择东西.也许在我单击菜单后的某个时间,Visual Studio会查看选定的项目,感到困惑,并显示错误消息吗?

Another colleague suggested it's because after clicking Debug > Start new instance, while I'm waiting for it to start up, I click on a different project. I don't do it for any reason, just randomly selecting things as I wait for the project to start up. Maybe Visual Studio looks at the selected project sometime after I clicked the menu, gets confused, and shows the error message?

任何人都可以确认这与他们的经历相符吗?

Anyone able to confirm this matches their experience?

这篇关于具有类库输出类型的项目无法直接启动-使用启动exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆