After pushing my asp.net mvc (with spark view engine) project to our live server yesterday I've started getting a strange error. Everything works fine initially, but after some time (maybe 30 minutes) the views start throwing "Dynamic view compilation failed" errors and complaining about namespaces not existing. The assemblies for the namespaces listed are in the bin (since it did work initially). I'm using the spark view engine on other websites running on the same box and have never seem this issue. What is causing these views to stop working?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
- Install ASP.NET 5.0 version of System.ServiceModel
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
- entity type has no key defined - Code first
As qstarin mentioned, recycling the AppPool does seem to kick the assemblies out. Here's the original Spark discussion regarding the issue:
http://groups.google.com/group/spark-dev/browse_thread/thread/dbee06a0d1b2766f#
In general, it seems the issue is caused by Spark trying to compile the views BEFORE the AppPool has had time to load all of the assemblies.
Picking the assemblies one-by-one still seemed to cause random glitches for me, so I tweaked the code in that discussion post and load it as the first line in Application_Start(). Since then, I've pushed out a dozen or so applications over time and haven't seen the precompile issue once.
and then your Application_Start():