Search code examples
c#async-awaitasync-ctpc#-5.0

Runtime Error in C#


I have installed Async-CTP-v3 for using new feature of C# 5 but when I tried to run a console application using async keyword/await expression this error appeared:

"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."

Is there anyone can help me? Thanks.


Solution

  • Your project's output type is almost certainly set to "Class Library".

    You can change the Project's Output type by right-clicking on your project in Solution Explorer and selecting properties in the context menu. Here you can choose the Output type from a drop-down menu. Change your project's output type from "Class Library" to "Console Application"

    If that does not work, double check your startup project and make sure it's the project you think it is (and should be).