From 0c29704d09f3de8a79a3c7df8330a5de8ff3f879 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Sun, 9 Dec 2012 04:13:09 +0500 Subject: [PATCH] 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. --- src/Umbraco.Core/TypeFinder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Umbraco.Core/TypeFinder.cs b/src/Umbraco.Core/TypeFinder.cs index 48c3a4deeb..e25b092e11 100644 --- a/src/Umbraco.Core/TypeFinder.cs +++ b/src/Umbraco.Core/TypeFinder.cs @@ -407,6 +407,10 @@ namespace Umbraco.Core private static IEnumerable GetTypesWithFormattedException(Assembly a) { + //if the assembly is dynamic, do not try to scan it + if (a.IsDynamic) + return Enumerable.Empty(); + try { return a.GetExportedTypes();