Jim McKintosh
Jim McKintosh

Reputation: 3

How do I debug a ASP.NET application

I have a ASP.NET application I've inherited from the person who did my job previously, when I try to debug the program I get the error below:

A project with an output type of class librart cannot be started directly

I'm familiar with desktop programs but I'm new to working with ASP.NET, the code is easy enough to understand but I can't get my head around how to successfully debug it.

PS VS 2008 if that helps.

Thanks

Jim

Upvotes: 0

Views: 195

Answers (5)

kervin
kervin

Reputation: 11858

You don't have the correct project as the "Startup Project". To make a project the startup project, right-click on that project in the solution explorer and select "Set as Startup Project".

Make sure your startup project is a "Website Project" or a "Web Project"

EDIT

Here is a blog showing the process with Visual Studio 2008 http://davidtse916.wordpress.com/2008/01/22/setting-the-startup-project-in-visual-studio-2008/

Upvotes: 1

Rob Gray
Rob Gray

Reputation: 3266

Another options is attaching the debugger to asp.net worker process e.g. w3wp.exe Then interact with your website as you normally would.

Just remember you can't debug like this if your w3wp.exe doesn't reflect the current state of your source.

Upvotes: 2

kemiller2002
kemiller2002

Reputation: 115538

You are trying to connect to a class library (dll). You need to attach to the Web Application. If you have all the projects in the same solution, you'll need to find the one that is the web site or web application and set it to "set as startup project" (I may be a little off on the verbiage, but it is roughly that.).

Link to msdn:

http://msdn.microsoft.com/en-us/library/w2faa92k(VS.71).aspx

Upvotes: 5

Dustin Laine
Dustin Laine

Reputation: 38543

You are attempting to start a class library as a runnable application. If you have multiple projects, which if it is a web application then you must, right click on the web project and choose "Set as startup project"

Upvotes: 1

Waleed Al-Balooshi
Waleed Al-Balooshi

Reputation: 6406

Does your ASP.Net Solution include another project of type Class Library? If so, it is possible that the class library project is setup as the default project, so you just need to change it to the ASP.Net project and it should work.

Upvotes: 1

Related Questions