[英]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. 我已经开始了软件开发的第一期实习,当查看数百个文件和代码行时,很难找到一旦为特定程序加载了所有程序集和“东西”后将要执行的第一行代码项目,但我认为这对于理解Web App的工作方式将是有益的。逐步进行的操作,因此,我希望从头开始逐步进行每一行代码。 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.
我看了Visual Studio为该项目创建的自动化类图(这对您有所帮助),但我仍然认为单步执行整个应用程序将是有益的。
How do I debug from the first line of code executed without setting a breakpoint? 如何在不设置断点的情况下从执行的第一行代码进行调试?
Step over - F10 by default. 跳过-默认情况下为F10。
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:
也就是说,所有WinForms的95%将以:
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. 如果是Web应用程序,请转到索引页面或主页以及页面的页面加载事件。 If it's a Windows app, go to the start up form.
如果是Windows应用程序,请转到启动表单。 Add a break point and debug.
添加一个断点并调试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.