Reactions to story from Zen and the art of Castle maintenance
Autoregistration without Binsor
http://hammett.castleproject.org/ ?p=286
Autoregistration without Binsor May 13th, 2008 On my Global.cs I usually have: private static void RegisterWebComponents() { container.Register(AllTypes.Of<SmartDispatcherController>(). FromAssembly(typeof(HomeController).Assembly)); container.Register(AllTypes.Of<ViewComponent>().FromAssembly(typeof(Global).Assembly) .Configure( delegate(ComponentRegistration reg) { reg.Named(reg.ServiceType.Name); })); } To get Windsor integration: First, make the Global implement the IContainerAccessor public class Global : HttpApplication, IContainerAccessor Then add a static field to
Reactions / posts that link to this post
-
Registering MonoRail Extensions Programatically
http://sradack.blogspot.com/2008/05/registering-monorail-ext...Hammett inspired me to switch from XML configuration to programmatic configuration of MonoRail with this blog post. But he didn't discuss how to configure MonoRail extensions. I searched around through the source and came up with this solution: public void Configure(IMonoRailConfiguration configuration) { configuration.ViewEngineConfig.ViewPathRoot = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Views"); configuration.ViewEngineConfig.ViewEngines.Add(new ViewEngineInfo(typeof(NVelocityViewEngine), false)); configuration.ConfigurationSection = new MutableConfiguration("monorail"); configuration.ConfigurationSection.Children.Add( new MutableConfiguration("exception") .CreateChild("exceptionHandler") .Attribute("type", typeof(EmailHandler).AssemblyQualifiedName) .Attribute("mailTo", "to@email.com") .Attribute("mailFrom", "from@email.com")); configuration.ExtensionEntries.Add( new ExtensionEntry(typeof(ExceptionChainingExtension), new MutableConfiguration(""))); } This code sets up the EmailHandler that comes with MonoRail.
More rising blog posts
More rising news stories
-
Entertainment »
iPod Touch Can Act as Music Remote -
Business »
Five Things Steve Jobs Must Do Before He Dies -
Lifestyle »
Obama's speech seen by 38 million-plus viewers -
Politics »
Analysis: McCain gambles with surprise pick - USATODAY.com -
Sports »
Rob Bagchi: What is the best name in football? -
Technology »
GOOGLE OKS YAHOO! PLAN
Recent posts from Zen and the art of Castle maintenance
-
Seducted by the evil empire?
5 hours ago -
MS Blog
15 days ago -
Joining Microsoft
45 days ago