简体   繁体   English

如何从要执行的第一行代码中调试Visual Studio中的Web App

[英]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.

相关问题 如何在Visual Studio代码上调试AspNet 5应用程序? - How to debug AspNet 5 app on Visual Studio Code? 如何从代码中检测Visual Studio调试执行上下文? - How to detect Visual Studio debug execution context from within code? 类中的 Visual Studio C# Web API 项目代码未执行 - Visual Studio C# Web API Project code in class not executed 如何将已发布的Web应用程序从Azure导入到Visual Studio for Web - How to import a published Web app from azure to visual studio for web 如何在 Visual Studio Code 中调试 specflow 测试 - how to debug specflow test in Visual Studio Code 模块化Web应用程序-在Visual Studio中调试模块代码 - Modular web application - Debug module code in Visual Studio 我们如何在 Visual Studio Code 中调试 ASP.NET MVC Web 应用程序? - How can we debug ASP.NET MVC web application in Visual Studio Code? 如何从命令行运行 Visual Studio 生成的 ASP.NET Core 示例 Web 应用 Docker 映像? - How to run Visual Studio generated ASP.NET Core Sample Web App Docker image from command line? 如何在构造函数中包含 Visual Studio 在设计时不会执行的代码? - How to have code in the constructor that will NOT be executed at design time by Visual Studio? 如何在Visual Studio代码中调试C#代码 - How to Debug C# code in visual studio code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM