简体   繁体   中英

How to debug a Web App in Visual Studio from the first line of code to be executed

I've started my first internship in software development, and when looking at hundreds of files and lines of code, it's incredibly hard to find the first line of code that will be executed once all the assemblies and "stuff" are loaded for a particular project, but I think it would be beneficial for understanding how the Web App works.. What happens step-by-step, and for that reason I want to step through each line of code from the beginning. I took a look at the automated class diagram that Visual Studio created for the project (it was some help), but I still think stepping through the entire app would be beneficial.

How do I debug from the first line of code executed without setting a breakpoint?

Step over - F10 by default.

Note that many types of projects may not be debugguble that way (like class libraries, web sites) or not going to give you any benefit - except possibly console application - due to event driven nature. Ie 95% of all WinForms will start with:

  var form = new MainForm();
  Application.Run();

You best option is to ask around for tips on where to put breakpoints or at least on basic architecture. Plus understanding how default project of given type is setup would be more helpful than dubugging production code first.

If it's a web application, go to the index page or home page and page load event of the page. If it's a Windows app, go to the start up form. Add a break point and debug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM