Sitemap not working with Castle Windsor IoC

Sep 27, 2010 at 9:35 AM

Hi

I have used MVCSiteMapProvider in my project. It was working fine until I used IoC Castle Windsor. I now have WindsorControllerFactory which handels the call to controllers instead of DefaultControllerFactory. If I remove the WindsorControllerFactory and let the default controller factory handle the requests then the sitemap works.

Do I have to implement IControllerTypeResolver and IActionMethodParameterResolver? Or this should work out of the box.

When I run my project now, I get the below error,

at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)

at System.Reflection.Assembly.GetTypes()

at MvcSiteMapProvider.DefaultControllerTypeResolver.<>c__DisplayClass18.b__c(Assembly a) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultControllerTypeResolver.cs
line 157

at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()

at System.Linq.Enumerable.d__31`3.MoveNext()

at MvcSiteMapProvider.DefaultControllerTypeResolver.GetControllerTypeWithinNamespaces(String area, String controller, HashSet`1 namespaces) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultControllerTypeResolver.cs
line 166

at MvcSiteMapProvider.DefaultControllerTypeResolver.ResolveControllerType(String areaName, String controllerName) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultControllerTypeResolver.cs
line 69

at MvcSiteMapProvider.DefaultActionMethodParameterResolver.ResolveActionMethodParameters(IControllerTypeResolver controllerTypeResolver, String areaName, String controllerName, String actionMethodName) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultActionMethodParameterResolver.cs
line 58

at MvcSiteMapProvider.DefaultSiteMapProvider.NodeMatchesRoute(MvcSiteMapNode mvcNode, IDictionary`2 values) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs
line 689

at MvcSiteMapProvider.DefaultSiteMapProvider.FindControllerActionNode(SiteMapNode rootNode, IDictionary`2 values) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs
line 650

at MvcSiteMapProvider.DefaultSiteMapProvider.FindSiteMapNode(HttpContext context) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs
line 609

at Dealogic.Web2.Security.DydApplicationSiteBuilder.GetCurrentNode() in C:\Analytics\Trunk\Internet\Dealogic.Portal\Dealogic.Web2\Security\DydApplicationSiteBuilder.cs
line 36

 

 

Sep 28, 2010 at 8:42 AM
Edited Sep 28, 2010 at 8:45 AM

It's interesting, because I use this IoC too and all works like a charm :) What revision of MvcSiteMap do you use? What kind of exception (type, message) you have?

Sep 30, 2010 at 1:00 PM

Thanks for the response.

The issue is resolved using the latest version of the dll.