2

sometimes i have problems with the debug. I have a solution with some projects (1 WPF application, 1 console application and some libraries - the console application host some services and the wpf application is the client).

If i want debug the client (or the host) visual studio means it can not be started because it is a class library. But after some tries and restarts of Visual Studio i can debug one of the projects without problems!

Is there a solution for this problem?

Mfg

edit#1: i have already set a startup project. If i want to debug the client, the host will be the startup project. If i want to debug the host, the client will be the startup project.

Pippl
  • 163
  • 2
  • 11
  • if i want to debug the host (console app) i start the client with "control+F5" and the host over the context menu -> debug -> start a new instance – Pippl Oct 06 '11 at 07:15
  • If you open your .sln file in some text editor: is the first included project some library of your host or client? – rudolf_franek Oct 06 '11 at 07:30
  • The first project listed in the .sln file is a library (used by another library which is used by the client/host app). – Pippl Oct 06 '11 at 07:37
  • Can you try this answer, because it helped me http://stackoverflow.com/questions/11152272/a-project-with-an-output-type-of-class-library-cannot-be-started-directly/25843029#25843029 – Jerric Lyns John Sep 15 '14 at 07:47

2 Answers2

2

When using Visual Studio 2010 (probably even before that ;)), you can specify multiple startup projects. Just right click on the solution, click Set Startup Projects and choose radio button item Multiple startup projects. You can now set the Action property to Start (with or without debugging) for all projects you like.

DotBert
  • 1,262
  • 2
  • 16
  • 29
1

If you are just hitting debug and haven't set a default debug start project, then it will try and debug the current project, which may well be a class library.

Set the default project by right cliking on a project in SOlutions Explorer and Set As StartUp Project.

cjk
  • 45,739
  • 9
  • 81
  • 112
  • i have already set a startup project. So if i want to debug the client, the host will be the startup project and i press "control+f5" to start the host and then right clicking the client project -> debug -> start new instance – Pippl Oct 06 '11 at 07:24