issues with external assembly references

Sep 8, 2009 at 2:06 AM

Nice project!

I was trying to use MvcSiteMap in a web site based on the S#arp Architecture project, but the MvcSiteMapProvider.ProcessNodesInAssembly method throws a ReflectionTypeLoadException exception calling GetTypes on the Castle.Services.Logging.Log4netIntegration.dll assembly.

The issue is that Castle.Services.Logging.Log4netIntegration.dll references Castle.Core.dll version, while the current version is

To reproduce, just download the latest version of SharpArchitecture, and in your sample project add references to all the Castle*.dll assemblies in the build folder.

In my code I just put a try/catch(ReflectionTypeLoadException) around the offending loop ( "foreach (Type type in assembly.GetTypes())...", line 453 ) and swallowed the exception.

To my mind this could be a good enough solution in most cases, real issues with assembly references should anyway not be the responsability of the map provider.

As an alternative, you might want to provide an assembly exclusion list in the configuration file.




Sep 8, 2009 at 8:35 AM

You can also disable assembly scanning for sitemap nodes, though you'll lose that functionality.

I'll check if I can add a nifty solution.

Sep 8, 2009 at 8:37 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.