Best Way to Add Routes in a NuGet Package

Mar 1, 2011 at 10:22 PM

What's the recommended way to add route values to the RouteDictionary (set up in Global.asax) via a Nuget package?  I have one set up now for isis (Install-Package isis) that simply has a Global_MERGEME.asax.cs file in the root, and I leave it to the user to do some copy and paste, but I'm assuming (hoping!) there is a better convention for this.  Any tips?




Mar 1, 2011 at 10:24 PM

Using WebActivator is the preferred way, so that users don't need to manually edit their global.asax file.

Mar 1, 2011 at 10:59 PM


Nice, it looks like you just updated it today to version 1.4.  I'm working on rebuilding my Route setup for Isis now (at the MVP summit...).  It's probably a common enough request that you might want to do a blog post just showing how to do route setup using WebActiviator...

Mar 1, 2011 at 11:02 PM

Agreed. I think there was some debates amond the MVC guys whether route registration was better done in PreStart (before global.asas App_Start) or in PostStart. This choice can affect the order in which they end up, and routes can certainly be sensitive to ordering.