MVC routes lost after app pool recycle (updated title 3/3/14)

后端 未结 2 1690
野的像风
野的像风 2021-01-22 05:20

I am trying to deploy an ASP.NET MVC 4 web application to a production server (Windows Server 2008 R2 [x64] with SP1 installed, running IIS 7.5) that already has several other w

相关标签:
2条回答
  • 2021-01-22 05:28

    The problem was with my publish settings. I was using the following precompile options in Visual Studio 2012:

    enter image description here

    By selecting 'do not merge' or 'merge all outputs to a single assembly', the problem was alleviated.

    UPDATE:

    The problem resumed even with the other settings, it just didn't happen right away. I had to disable precompiling altogether.

    0 讨论(0)
  • 2021-01-22 05:50

    I want to give my 2 cents here. I had this exact behaviour on Windows Server 2012.

    My problem had nothing with configuration but the fact the global.asax was having an exception in the Application_Start and my code to register the routing table never occurred after the recycle. So if you have this behaviour, make sure you trap exceptions and handle them so all your code execute.

    0 讨论(0)
提交回复
热议问题