diff --git a/Oqtane.Server/Extensions/OqtaneMvcBuilderExtensions.cs b/Oqtane.Server/Extensions/OqtaneMvcBuilderExtensions.cs index b3f489bf..13668322 100644 --- a/Oqtane.Server/Extensions/OqtaneMvcBuilderExtensions.cs +++ b/Oqtane.Server/Extensions/OqtaneMvcBuilderExtensions.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.Linq; using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApplicationParts; using Oqtane.Infrastructure; +using Microsoft.AspNetCore.Mvc.RazorPages; // ReSharper disable once CheckNamespace namespace Microsoft.Extensions.DependencyInjection @@ -22,7 +23,7 @@ namespace Microsoft.Extensions.DependencyInjection foreach (var assembly in assemblies) { // check if assembly contains MVC Controllers - if (assembly.GetTypes().Any(t => t.IsSubclassOf(typeof(Controller)))) + if (assembly.GetTypes().Any(t => t.IsSubclassOf(typeof(Controller)) || t.IsSubclassOf(typeof(Page)))) { var partFactory = ApplicationPartFactory.GetApplicationPartFactory(assembly); foreach (var part in partFactory.GetApplicationParts(assembly))