Can't break in global.asax / Application_Start

后端 未结 9 1155
名媛妹妹
名媛妹妹 2021-02-01 16:49

I got a break point on the first line of Application_Start(), but Visual Studio wont break on it.

Visual Studio have attached itself to the IIS working proc

9条回答
  •  孤独总比滥情好
    2021-02-01 17:33

    I assume you're loading the application by clicking the "debug" button in Visual Studio? That's what I'm doing (in VS 2012) and seeing similar problems. Pressing that button the first time starts the application and correctly hits the breakpoint. But it seems like after I stop debugging the application itself keeps going. So, future attempts to debug just attach to the existing process.
    There's a "restart" button next to the "stop debugging" button, so I'd assume clicking that at least would change things. The debugging app does not show up in IIS manager, so I can't stop it there. Likewise, iisreset doesn't catch it either.

    Only thing I've figured out so far is to change a line of code, thereby forcing visual studio to trigger a build and then it kills the existing proc and starts over. Kind of annoying if I just want to step through there multiple times.

    I don't consider this a suitable "answer", but it might be a helpful workaround for you until somebody does come in with a real answer.

提交回复
热议问题