开发者

How do I debug a ASP.NET application

开发者 https://www.devze.com 2022-12-23 04:34 出处:网络
I have a ASP.NET application I\'ve inherited from the person who did my job previously, when I try to debug the progr开发者_如何学运维am I get the error below:

I have a ASP.NET application I've inherited from the person who did my job previously, when I try to debug the progr开发者_如何学运维am 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


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


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.


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.


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"


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消