I am adding a route dynamically to the RouteTable, but the update is not propagating to the other processes:
using (RouteTable.Routes.GetWriteLock())
{
RouteTable.Routes.MapPageRoute(
String.Format("_{0}", routeName),
routeName,
"~/Template.aspx",
true,
new RouteValueDictionary {{"page", routeName}});
}
This correctly creates the correct route, as I can access it sometimes, but if get switched to a new process or if I try a bit later on, I can't access the page. If I then restart the app pool, it works fine. Also if I wait long enough, a few hours, when the processes have been recycled, the routes work.
I am thinking that this is a result of a route being created on the one process, and only on future process recycles.
Hay ideas on how to push the route updates out?