Why does not the Application_Start() event fire when I debug my ASP.NET MVC app?

后端 未结 12 1754
独厮守ぢ
独厮守ぢ 2021-01-30 16:01

I currently have the following routines in my Global.asax.cs file:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRout         


        
12条回答
  •  清歌不尽
    2021-01-30 16:22

    I found the problem:

    This MVC application was part of a larger solution, in which I had at one point set another project to build for an x86 environment (I'm running x64). When I did that, apparently all other projects - even those added later - were set not to build on Ctrl+Shift+B, and I suppose that's why the debugger didn't hit my breakpoint.

    Solution:

    Go into the solution build properties (right-click Solution, select properties, and select Build on the menu on the left), and put a check in the Build checkbox next to the project name in the list.

提交回复
热议问题