简体   繁体   English

附加用于在Visual Studio中进行调试的过程

[英]Attach a process for debugging in Visual Studio

I am hosting an application on IIS but application gets up very late when I restart IIS. 我在IIS上托管应用程序,但是重新启动IIS时应用程序启动得很晚。 So I want to debug it at the begining of the application start but I cannot attach a process if the application doesnt start. 因此,我想在应用程序启动时对其进行调试,但是如果应用程序未启动,则无法附加进程。 so what is the proper way to debug an application that is host on IIS when the application firstly begin ? 那么,当应用程序首次启动时,调试在IIS上托管的应用程序的正确方法是什么?

如何在Global.Application_Start放入Debugger.Launch()

One way is to select Start Debugging from the Debug menu in Visual Studio. 一种方法是从Visual Studio的“调试”菜单中选择“开始调试”。

Another way is to add a System.Diagnostics.Debug.Fail("test") to the location within the code that you want to break, then reset IIS and attach to IIS from VS. 另一种方法是将System.Diagnostics.Debug.Fail("test")到要中断的代码中的位置,然后重置IIS并从VS附加到IIS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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