Fixes TypeFinder to not scan for types when the assembly IsDynamic (created using reflection Emit).

This fixes the RenderRouteHandlerTests which were failing due to a sequence of events when the new PetaPoco classes
were created using Reflection and then the TypeFinder tries to enumerate on them.
This commit is contained in:
Shannon Deminick
2012-12-09 04:13:09 +05:00
parent e251ccf456
commit 0c29704d09

View File

@@ -407,6 +407,10 @@ namespace Umbraco.Core
private static IEnumerable<Type> GetTypesWithFormattedException(Assembly a)
{
//if the assembly is dynamic, do not try to scan it
if (a.IsDynamic)
return Enumerable.Empty<Type>();
try
{
return a.GetExportedTypes();