What is the difference between Start Debugging and

2019-04-10 08:29发布

My project loads significantly faster when I attach it to my w3wp.exe IIS worker process, than when I "Start Debugging".

However, the same worker process seems to be processing the same amount of modules/DLLs (w3wp.exe) whether I "Start Debugging" or "Attach to Process".

Why is attaching to a process so much quicker?

2条回答
欢心
2楼-- · 2019-04-10 09:00

The code without debugging performs much for faster. When you attach the process the application is already started, pool is started, so you do not perform some heavy operations in debug mode, for example Application_OnStart event and some others.

查看更多
虎瘦雄心在
3楼-- · 2019-04-10 09:08

"Start Debugging" launches a new instance of the executable with the debugger attached right from the beginning, so the overhead of all the needed debugger calls is incurred from launch, whereas "Attach to Process" attaches to a already running process, so until then your process was running without any additional overhead caused by debugging.

查看更多
登录 后发表回答