From 8a192a00653b61d2db35dfe846fb72207af78f74 Mon Sep 17 00:00:00 2001 From: "shannon@ShandemVaio" Date: Wed, 1 Aug 2012 23:50:33 +0600 Subject: [PATCH] Renamed TypeFinder2 to Umbraco.Core.TypeFinder. Obsoleted old TypeFinder and cleaned up non-used methods in the new TypeFinder. Updated some unit tests and removed benchmark tests since we already have the benchmarks. --- src/Umbraco.Core/PluginManager.cs | 8 +- .../{TypeFinder2.cs => TypeFinder.cs} | 175 ++--------------- src/Umbraco.Core/Umbraco.Core.csproj | 2 +- src/Umbraco.Tests/ContentStoreTests.cs | 7 +- src/Umbraco.Tests/PluginManagerTests.cs | 2 +- src/Umbraco.Tests/TypeFinderTests.cs | 92 +-------- src/umbraco.businesslogic/Utils/TypeFinder.cs | 180 ++---------------- src/umbraco.cms/Actions/Action.cs | 3 +- 8 files changed, 50 insertions(+), 419 deletions(-) rename src/Umbraco.Core/{TypeFinder2.cs => TypeFinder.cs} (65%) diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index a809db1e6c..3e00528dc0 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -109,7 +109,7 @@ namespace Umbraco.Core /// internal IEnumerable AssembliesToScan { - get { return _assemblies ?? (_assemblies = TypeFinder2.GetAssembliesWithKnownExclusions()); } + get { return _assemblies ?? (_assemblies = TypeFinder.GetAssembliesWithKnownExclusions()); } set { _assemblies = value; } } @@ -212,7 +212,7 @@ namespace Umbraco.Core /// internal IEnumerable ResolveTypes() { - return ResolveTypes(() => TypeFinder2.FindClassesOfType(AssembliesToScan)); + return ResolveTypes(() => TypeFinder.FindClassesOfType(AssembliesToScan)); } /// @@ -224,7 +224,7 @@ namespace Umbraco.Core internal IEnumerable ResolveTypesWithAttribute() where TAttribute : Attribute { - return ResolveTypes(() => TypeFinder2.FindClassesOfTypeWithAttribute(AssembliesToScan)); + return ResolveTypes(() => TypeFinder.FindClassesOfTypeWithAttribute(AssembliesToScan)); } /// @@ -236,7 +236,7 @@ namespace Umbraco.Core where TAttribute : Attribute { return ResolveTypes( - () => TypeFinder2.FindClassesWithAttribute(AssembliesToScan), + () => TypeFinder.FindClassesWithAttribute(AssembliesToScan), true); } diff --git a/src/Umbraco.Core/TypeFinder2.cs b/src/Umbraco.Core/TypeFinder.cs similarity index 65% rename from src/Umbraco.Core/TypeFinder2.cs rename to src/Umbraco.Core/TypeFinder.cs index e7d29b0399..6d1640fb51 100644 --- a/src/Umbraco.Core/TypeFinder2.cs +++ b/src/Umbraco.Core/TypeFinder.cs @@ -23,15 +23,11 @@ namespace Umbraco.Core /// A utility class to find all classes of a certain type by reflection in the current bin folder /// of the web application. /// - public static class TypeFinder2 + public static class TypeFinder { private static readonly ConcurrentBag LocalFilteredAssemblyCache = new ConcurrentBag(); private static readonly ReaderWriterLockSlim LocalFilteredAssemblyCacheLocker = new ReaderWriterLockSlim(); - /// - /// Caches attributed assembly information so they don't have to be re-read - /// - private static readonly AttributedAssemblyList AttributedAssemblies = new AttributedAssemblyList(); private static ReadOnlyCollection _allAssemblies = null; private static ReadOnlyCollection _binFolderAssemblies = null; private static readonly ReaderWriterLockSlim Locker = new ReaderWriterLockSlim(); @@ -188,69 +184,6 @@ namespace Umbraco.Core "Examine." }; - - - - - - - /// - /// Returns assemblies found in the specified path that the the specified custom attribute type applied to them - /// - /// - /// The assemblies to search on - /// - internal static IEnumerable FindAssembliesWithAttribute(IEnumerable assemblies) - where T : Attribute - { - - var foundAssemblies = (from a in assemblies - //if its already registered, then ignore - where !AttributedAssemblies.IsRegistered(a) - let customAttributes = a.GetCustomAttributes(typeof(T), false) - where customAttributes.Any() - select a).ToList(); - //now update the cache - foreach (var a in foundAssemblies) - { - AttributedAssemblies.Add(new AttributedAssembly { Assembly = a, PluginAttributeType = typeof(T), AssemblyFolder = null }); - } - - //We must do a ToList() here because it is required to be serializable when using other app domains. - return AttributedAssemblies - .Where(x => x.PluginAttributeType == typeof(T) - && assemblies.Select(y => y.FullName).Contains(x.Assembly.FullName)) - .Select(x => x.Assembly) - .ToList(); - } - - /// - /// Returns found types in assemblies attributed with the specifed attribute type - /// - /// - /// - /// The assemblies to search on - /// - internal static IEnumerable FindClassesOfType(IEnumerable assemblies) - where TAssemblyAttribute : Attribute - { - var found = FindAssembliesWithAttribute(assemblies); - return GetAssignablesFromType(found, true); - } - - /// - /// Returns found types in an assembly attributed with the specifed attribute type - /// - /// - /// The type of the assembly attribute. - /// The assembly. - /// - /// - internal static IEnumerable FindClassesOfType(Assembly assembly) - where TAssemblyAttribute : Attribute - { - return FindClassesOfType(new[] { assembly }); - } public static IEnumerable FindClassesOfTypeWithAttribute() where TAttribute : Attribute @@ -328,14 +261,28 @@ namespace Umbraco.Core /// public static IEnumerable FindClassesWithAttribute(IEnumerable assemblies, bool onlyConcreteClasses) where T : Attribute + { + return FindClassesWithAttribute(typeof(T), assemblies, onlyConcreteClasses); + } + + /// + /// Finds the classes with attribute. + /// + /// The attribute type + /// The assemblies. + /// if set to true only concrete classes. + /// + public static IEnumerable FindClassesWithAttribute(Type type, IEnumerable assemblies, bool onlyConcreteClasses) { if (assemblies == null) throw new ArgumentNullException("assemblies"); + if (!TypeHelper.IsTypeAssignableFrom(type)) + throw new ArgumentException("The type specified: " + type + " is not an Attribute type"); var l = new List(); foreach (var a in assemblies) { var types = from t in GetTypesWithFormattedException(a) - where !t.IsInterface && t.GetCustomAttributes(false).Any() && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract)) + where !t.IsInterface && t.GetCustomAttributes(type, false).Any() && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract)) select t; l.AddRange(types); } @@ -367,67 +314,8 @@ namespace Umbraco.Core } - #region Internal Attributed Assembly class - - //These can be removed once we implement the .hash file for caching assemblies that are found containing plugin types. - // Once that is done, remove these classes and remove the TypeFinder test: Benchmark_Finding_First_Type_In_Assemblies - - private class AttributedAssembly - { - internal DirectoryInfo AssemblyFolder { get; set; } - internal Assembly Assembly { get; set; } - internal Type PluginAttributeType { get; set; } - } - private class AttributedAssemblyList : List - { - /// - /// Determines if that type has been registered with the folder - /// - /// - /// - /// - internal bool IsRegistered(DirectoryInfo folder) - { - return this.Any(x => x.PluginAttributeType == typeof(T) - && x.AssemblyFolder.FullName.ToUpper() == folder.FullName.ToUpper()); - } - - /// - /// Determines if the assembly is already registered - /// - /// - /// - /// - internal bool IsRegistered(Assembly assembly) - { - return this.Any(x => x.PluginAttributeType == typeof(T) - && x.Assembly.FullName.ToUpper() == assembly.FullName.ToUpper()); - } - } - - #endregion - #region Private methods - private static IEnumerable GetTypesFromResult(Dictionary result) - { - return (from type in result - let ass = Assembly.Load(type.Value) - where ass != null - select ass.GetType(type.Key, false)).ToList(); - } - - /// - /// Gets a collection of assignables of type T from a collection of files - /// - /// - /// The files. - /// - /// - private static Dictionary GetAssignablesFromType(IEnumerable files, bool onlyConcreteClasses) - { - return GetTypes(typeof(T), files, onlyConcreteClasses); - } - + /// /// Gets a collection of assignables of type T from a collection of assemblies /// @@ -471,35 +359,6 @@ namespace Umbraco.Core } } - /// - /// Returns of a collection of type names from a collection of assembky files. - /// - /// The assign type. - /// The assembly files. - /// - /// - private static Dictionary GetTypes(Type assignTypeFrom, IEnumerable assemblyFiles, bool onlyConcreteClasses) - { - var result = new Dictionary(); - foreach (var assembly in - assemblyFiles.Where(File.Exists).Select(Assembly.LoadFile).Where(assembly => assembly != null)) - { - try - { - foreach (Type t in - assembly.GetExportedTypes().Where(t => !t.IsInterface && assignTypeFrom.IsAssignableFrom(t) && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract)))) - { - //add the full type name and full assembly name - result.Add(t.FullName, t.Assembly.FullName); - } - } - catch (ReflectionTypeLoadException ex) - { - Debug.WriteLine("Error reading assembly " + assembly.FullName + ": " + ex.Message); - } - } - return result; - } #endregion diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index c9d3889ce2..062e7c80c6 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -84,7 +84,7 @@ - + diff --git a/src/Umbraco.Tests/ContentStoreTests.cs b/src/Umbraco.Tests/ContentStoreTests.cs index d49ac65e2b..d435401ad8 100644 --- a/src/Umbraco.Tests/ContentStoreTests.cs +++ b/src/Umbraco.Tests/ContentStoreTests.cs @@ -19,7 +19,12 @@ namespace Umbraco.Tests [SetUp] public void Initialize() { - //reset each test + + } + + [TearDown] + public void TearDown() + { Resolution.IsFrozen = false; } diff --git a/src/Umbraco.Tests/PluginManagerTests.cs b/src/Umbraco.Tests/PluginManagerTests.cs index f193dc75bf..6fe4525cf0 100644 --- a/src/Umbraco.Tests/PluginManagerTests.cs +++ b/src/Umbraco.Tests/PluginManagerTests.cs @@ -46,7 +46,7 @@ namespace Umbraco.Tests typeof(System.Web.SiteMap).Assembly, typeof(TabPage).Assembly, typeof(System.Web.Mvc.ActionResult).Assembly, - typeof(TypeFinder2).Assembly, + typeof(TypeFinder).Assembly, typeof(ISqlHelper).Assembly, typeof(DLRScriptingEngine).Assembly, typeof(ICultureDictionary).Assembly, diff --git a/src/Umbraco.Tests/TypeFinderTests.cs b/src/Umbraco.Tests/TypeFinderTests.cs index 6c14b161bf..a136abdc2d 100644 --- a/src/Umbraco.Tests/TypeFinderTests.cs +++ b/src/Umbraco.Tests/TypeFinderTests.cs @@ -17,8 +17,6 @@ using umbraco.businesslogic; using umbraco.cms.businesslogic; using umbraco.uicontrols; -[assembly: TypeFinderTests.AssemblyContainsPluginsAttribute] - namespace Umbraco.Tests { /// @@ -51,28 +49,15 @@ namespace Umbraco.Tests typeof(System.Web.SiteMap).Assembly, typeof(TabPage).Assembly, typeof(System.Web.Mvc.ActionResult).Assembly, - typeof(TypeFinder2).Assembly, + typeof(TypeFinder).Assembly, typeof(ISqlHelper).Assembly, typeof(DLRScriptingEngine).Assembly, typeof(ICultureDictionary).Assembly }; - //we need to copy the umbracoSettings file to the output folder! - File.Copy( - Path.Combine(TestHelper.CurrentAssemblyDirectory, "..\\..\\..\\Umbraco.Web.UI\\config\\umbracoSettings.Release.config"), - Path.Combine(TestHelper.CurrentAssemblyDirectory, "umbracoSettings.config"), - true); - UmbracoSettings.SettingsFilePath = TestHelper.CurrentAssemblyDirectory + "\\"; - } - - /// - /// Informs the system that the assembly tagged with this attribute contains plugins and the system should scan and load them - /// - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] - public class AssemblyContainsPluginsAttribute : Attribute - { } + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class MyTestAttribute : Attribute { @@ -100,81 +85,12 @@ namespace Umbraco.Tests public void Get_Type_With_Attribute() { - var typesFound = TypeFinder2.FindClassesOfTypeWithAttribute(_assemblies); + var typesFound = TypeFinder.FindClassesOfTypeWithAttribute(_assemblies); Assert.AreEqual(2, typesFound.Count()); } - - [Test] - [Ignore("This is a benchark test")] - public void Benchmark_Old_TypeFinder_vs_New_TypeFinder_FindClassesWithAttribute() - { - var timer = new Stopwatch(); - - timer.Start(); - var found1 = TypeFinder2.FindClassesWithAttribute(_assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find class with XsltExtensionAttribute (" + found1.Count() + ") in " + _assemblies.Count() + " assemblies using new TypeFinder: " + timer.ElapsedMilliseconds); - - timer.Start(); - var found2 = umbraco.BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(typeof(XsltExtensionAttribute), _assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find class with XsltExtensionAttribute (" + found2.Count() + ") in " + _assemblies.Count() + " assemblies using old TypeFinder: " + timer.ElapsedMilliseconds); - - Assert.AreEqual(found1.Count(), found2.Count()); - } - - [Test] - [Ignore("This is a benchark test")] - public void Benchmark_Old_TypeFinder_vs_New_TypeFinder_FindClassesOfType() - { - var timer = new Stopwatch(); - - - timer.Start(); - var found1 = TypeFinder2.FindClassesOfType(_assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find TestEditor (" + found1.Count() + ") in " + _assemblies.Count() + " assemblies using new TypeFinder: " + timer.ElapsedMilliseconds); - - timer.Start(); - var found2 = umbraco.BusinessLogic.Utils.TypeFinder.FindClassesOfType(true, true, _assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find TestEditor (" + found2.Count() + ") in " + _assemblies.Count() + " assemblies using old TypeFinder: " + timer.ElapsedMilliseconds); - - Assert.AreEqual(found1.Count(), found2.Count()); - } - - /// - /// To indicate why we had the AssemblyContainsPluginsAttribute attribute in v5, now just need to get the .hash and assembly - /// cache files created instead since this is clearly a TON faster. - /// - [Test] - [Ignore("This is a benchark test")] - public void Benchmark_Finding_First_Type_In_Assemblies() - { - var timer = new Stopwatch(); - - - timer.Start(); - var found1 = TypeFinder2.FindClassesOfType(_assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find TestEditor (" + found1.Count() + ") in " + _assemblies.Count() + " assemblies using AssemblyContainsPluginsAttribute: " + timer.ElapsedMilliseconds); - - timer.Start(); - var found2 = TypeFinder2.FindClassesOfType(_assemblies); - timer.Stop(); - - Console.WriteLine("Total time to find TestEditor (" + found2.Count() + ") in " + _assemblies.Count() + " assemblies without AssemblyContainsPluginsAttribute: " + timer.ElapsedMilliseconds); - - Assert.AreEqual(found1.Count(), found2.Count()); - } - + } } \ No newline at end of file diff --git a/src/umbraco.businesslogic/Utils/TypeFinder.cs b/src/umbraco.businesslogic/Utils/TypeFinder.cs index e69ca95ed5..6078af706a 100644 --- a/src/umbraco.businesslogic/Utils/TypeFinder.cs +++ b/src/umbraco.businesslogic/Utils/TypeFinder.cs @@ -15,73 +15,20 @@ namespace umbraco.BusinessLogic.Utils /// A utility class to find all classes of a certain type by reflection in the current bin folder /// of the web application. /// + [Obsolete("Use Umbraco.Core.TypeFinder instead")] public static class TypeFinder { - // zb-00044 #29989 : refactor FindClassesMarkedWithAttribute - - internal static IEnumerable FindClassesMarkedWithAttribute(Type attribute, IEnumerable assemblies) - { - List types = new List(); - bool searchGAC = false; - - foreach (Assembly assembly in assemblies) - { - // skip if the assembly is part of the GAC - if (!searchGAC && assembly.GlobalAssemblyCache) - continue; - - types.AddRange(FindClassesMarkedWithAttribute(assembly, attribute)); - } - - // also add types from app_code, if any - - var fileExtension = UmbracoSettings.AppCodeFileExtensionsList.ToArray(); - var appCodeFolder = new DirectoryInfo(IOHelper.MapPath(IOHelper.ResolveUrl("~/App_code"))); - if (appCodeFolder.Exists && appCodeFolder.GetFilesByExtensions(true, fileExtension).Any()) - { - types.AddRange(FindClassesMarkedWithAttribute(Assembly.Load("App_Code"), attribute)); - } - - return types.Distinct(); - } - /// /// Searches all loaded assemblies for classes marked with the attribute passed in. /// /// A list of found types + [Obsolete("Use Umbraco.Core.TypeFinder.FindClassesWithAttribute instead")] public static IEnumerable FindClassesMarkedWithAttribute(Type attribute) { - - return FindClassesMarkedWithAttribute(attribute, AppDomain.CurrentDomain.GetAssemblies()); - } - - static IEnumerable FindClassesMarkedWithAttribute(Assembly assembly, Type attribute) - { - // DF: Fix Codeplex #30479 - Dynamic assemblies in Umbraco cause XSLTs to break - TypeFinder.cs - // Just return if the assembly is dynamic. - if (assembly.ManifestModule.GetType().Namespace == "System.Reflection.Emit") return new List(); - - - try - { - return assembly.GetExportedTypes().Where(type => type.GetCustomAttributes(attribute, true).Length > 0); - } - catch (ReflectionTypeLoadException ex) - { - if (GlobalSettings.DebugMode) - { - StringBuilder sb = new StringBuilder(); - sb.AppendFormat("Unable to load one or more of the types in assembly '{0}'. Exceptions were thrown:", assembly.FullName); - foreach (Exception e in ex.LoaderExceptions) - sb.AppendFormat("\n{0}: {1}", e.GetType().FullName, e.Message); - throw new Exception(sb.ToString()); - } - else - { - // return the types that were loaded, ignore those that could not be loaded - return ex.Types; - } - } + return Umbraco.Core.TypeFinder.FindClassesWithAttribute( + attribute, + Umbraco.Core.TypeFinder.GetAssembliesWithKnownExclusions(), + true); } /// @@ -89,9 +36,10 @@ namespace umbraco.BusinessLogic.Utils /// /// The type of object to search for /// A list of found types + [Obsolete("Use Umbraco.Core.TypeFinder.FindClassesOfType instead")] public static List FindClassesOfType() { - return FindClassesOfType(true); + return Umbraco.Core.TypeFinder.FindClassesOfType().ToList(); } /// @@ -100,13 +48,12 @@ namespace umbraco.BusinessLogic.Utils /// The type of object to search for /// true if a seperate app domain should be used to query the types. This is safer as it is able to clear memory after loading the types. /// A list of found types + [Obsolete("Use Umbraco.Core.TypeFinder.FindClassesOfType instead")] public static List FindClassesOfType(bool useSeperateAppDomain) { - return FindClassesOfType(useSeperateAppDomain, true); + return Umbraco.Core.TypeFinder.FindClassesOfType().ToList(); } - - /// /// Searches all loaded assemblies for classes of the type passed in. /// @@ -114,110 +61,12 @@ namespace umbraco.BusinessLogic.Utils /// true if a seperate app domain should be used to query the types. This is safer as it is able to clear memory after loading the types. /// True to only return classes that can be constructed /// A list of found types + [Obsolete("Use Umbraco.Core.TypeFinder.FindClassesOfType instead")] public static List FindClassesOfType(bool useSeperateAppDomain, bool onlyConcreteClasses) { - return FindClassesOfType(useSeperateAppDomain, onlyConcreteClasses, null); - } - - - static string GetAssemblyPath(Assembly ass) - { - var codeBase = ass.CodeBase; - var uri = new Uri(codeBase); - return uri.LocalPath; - } - - internal static List FindClassesOfType(bool useSeperateAppDomain, bool onlyConcreteClasses, IEnumerable assemblies) - { - if (useSeperateAppDomain) - { - string binFolder = Path.Combine(IO.IOHelper.MapPath("/", false), "bin"); - - string[] strTypes; - if (assemblies == null) - { - strTypes = TypeResolver.GetAssignablesFromType(binFolder, "*.dll"); - } - else - { - strTypes = TypeResolver.GetAssignablesFromType(assemblies.Select(GetAssemblyPath).ToArray()); - } - - List types = new List(); - - foreach (string type in strTypes) - types.Add(Type.GetType(type)); - - // also add types from app_code - try - { - // only search the App_Code folder if it's not empty - DirectoryInfo appCodeFolder = new DirectoryInfo(IOHelper.MapPath(IOHelper.ResolveUrl("~/App_code"))); - if (appCodeFolder.GetFiles().Length > 0) - { - foreach (Type type in System.Reflection.Assembly.Load("App_Code").GetExportedTypes()) - types.Add(type); - } - } - catch { } // Empty catch - this just means that an App_Code assembly wasn't generated by the files in folder - - return types.FindAll(OnlyConcreteClasses(typeof(T), onlyConcreteClasses)); - } - else - return FindClassesOfType(typeof(T), onlyConcreteClasses); - } - - /// - /// Finds all classes with the specified type - /// - /// The type. - /// - /// - /// A list of found classes - private static List FindClassesOfType(Type type, bool onlyConcreteClasses, IEnumerable assemblies = null) - { - bool searchGAC = false; - - List classesOfType = new List(); - - Assembly[] a; - if (assemblies == null) - { - a = AppDomain.CurrentDomain.GetAssemblies(); - } - else - { - a = assemblies.ToArray(); - } - - foreach (Assembly assembly in a) - { - //don't check any types if the assembly is part of the GAC - if (!searchGAC && assembly.GlobalAssemblyCache) - continue; - - Type[] publicTypes; - //need try catch block as some assemblies do not support this (i.e.RefEmit_InMemoryManifestModule) - try - { - publicTypes = assembly.GetExportedTypes(); - } - catch { continue; } - - List listOfTypes = new List(); - listOfTypes.AddRange(publicTypes); - List foundTypes = listOfTypes.FindAll(OnlyConcreteClasses(type, onlyConcreteClasses)); - Type[] outputTypes = new Type[foundTypes.Count]; - foundTypes.CopyTo(outputTypes); - classesOfType.AddRange(outputTypes); - } - - return classesOfType; - } - - private static Predicate OnlyConcreteClasses(Type type, bool onlyConcreteClasses) - { - return t => (type.IsAssignableFrom(t) && (onlyConcreteClasses ? (t.IsClass && !t.IsAbstract) : true)); + return Umbraco.Core.TypeFinder.FindClassesOfType( + Umbraco.Core.TypeFinder.GetAssembliesWithKnownExclusions(), + onlyConcreteClasses).ToList(); } [Obsolete("This method is no longer used and will be removed")] @@ -240,5 +89,6 @@ namespace umbraco.BusinessLogic.Utils { return Umbraco.Core.SystemUtilities.GetCurrentTrustLevel(); } + } } diff --git a/src/umbraco.cms/Actions/Action.cs b/src/umbraco.cms/Actions/Action.cs index 1ed6d33f39..d7d290b66f 100644 --- a/src/umbraco.cms/Actions/Action.cs +++ b/src/umbraco.cms/Actions/Action.cs @@ -13,6 +13,7 @@ using umbraco.cms.businesslogic.workflow; using umbraco.interfaces; using System.Text.RegularExpressions; using System.Linq; +using TypeFinder = Umbraco.Core.TypeFinder; namespace umbraco.BusinessLogic.Actions { @@ -59,7 +60,7 @@ namespace umbraco.BusinessLogic.Actions //TODO: Based on the above, this is a big hack as types should all be cleared on package install! ActionsResolver.Current = new ActionsResolver( - TypeFinder2.FindClassesOfType(PluginManager.Current.AssembliesToScan)); + TypeFinder.FindClassesOfType(PluginManager.Current.AssembliesToScan)); RegisterIActionHandlers(); }