diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj
index 2400b9c291..906f4fc2c9 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj
@@ -18,10 +18,8 @@
-
-
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj
index 43f5bc20bf..c390cfe58c 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj
@@ -17,17 +17,11 @@
-
-
-
-
-
-
@@ -36,5 +30,5 @@
-
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj
index 66015b14a7..078563ace3 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj
@@ -17,11 +17,6 @@
-
-
-
-
-
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj
index 7c4147bba5..71e1257a4d 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj
@@ -18,16 +18,10 @@
-
-
-
-
-
-
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj
index 06afcf3f3e..9d0f384611 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj
@@ -17,9 +17,4 @@
-
-
-
-
-
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj
index ffdaf02d94..d14d639fbb 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo.Abp.AspNetCore.Mvc.UI.csproj
@@ -14,11 +14,6 @@
-
-
-
-
-
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs
index 77b517bc45..c7f3777466 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/Extensions/DependencyInjection/AbpMvcBuilderExtensions.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
@@ -8,13 +9,23 @@ namespace Microsoft.Extensions.DependencyInjection
{
public static void AddApplicationPartIfNotExists(this IMvcBuilder mvcBuilder, Assembly assembly)
{
- if (mvcBuilder.PartManager.ApplicationParts.Any(
+ mvcBuilder.PartManager.ApplicationParts.AddIfNotContains(assembly);
+ }
+
+ public static void AddApplicationPartIfNotExists(this IMvcCoreBuilder mvcCoreBuilder, Assembly assembly)
+ {
+ mvcCoreBuilder.PartManager.ApplicationParts.AddIfNotContains(assembly);
+ }
+
+ public static void AddIfNotContains(this IList applicationParts, Assembly assembly)
+ {
+ if (applicationParts.Any(
p => p is AssemblyPart assemblyPart && assemblyPart.Assembly == assembly))
{
return;
}
- mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
+ applicationParts.Add(new AssemblyPart(assembly));
}
}
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
index 6785cb710b..263178e0ed 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
@@ -10,6 +10,7 @@ using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
@@ -75,14 +76,14 @@ namespace Volo.Abp.AspNetCore.Mvc
(int) HttpStatusCode.NotImplemented,
(int) HttpStatusCode.InternalServerError
};
-
+
options.SupportedResponseTypes.AddIfNotContains(statusCodes.Select(statusCode => new ApiResponseType
{
Type = typeof(RemoteServiceErrorResponse),
StatusCode = statusCode
}));
});
-
+
context.Services.PostConfigure(options =>
{
if (options.MinifyGeneratedScript == null)
@@ -126,10 +127,10 @@ namespace Volo.Abp.AspNetCore.Mvc
return factory.Create(resourceType);
}
- return factory.CreateDefaultOrNull() ??
+ return factory.CreateDefaultOrNull() ??
factory.Create(type);
};
- })
+ })
.AddViewLocalization(); //TODO: How to configure from the application? Also, consider to move to a UI module since APIs does not care about it.
Configure(options =>
@@ -161,7 +162,7 @@ namespace Volo.Abp.AspNetCore.Mvc
var application = context.Services.GetSingletonInstance();
partManager.FeatureProviders.Add(new AbpConventionalControllerFeatureProvider(application));
- partManager.ApplicationParts.Add(new AssemblyPart(typeof(AbpAspNetCoreMvcModule).Assembly));
+ partManager.ApplicationParts.AddIfNotContains(typeof(AbpAspNetCoreMvcModule).Assembly);
Configure(mvcOptions =>
{
@@ -179,6 +180,14 @@ namespace Volo.Abp.AspNetCore.Mvc
});
}
+ public override void PostConfigureServices(ServiceConfigurationContext context)
+ {
+ ApplicationPartSorter.Sort(
+ context.Services.GetSingletonInstance(),
+ context.Services.GetSingletonInstance()
+ );
+ }
+
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
AddApplicationParts(context);
@@ -220,12 +229,7 @@ namespace Volo.Abp.AspNetCore.Mvc
{
foreach (var moduleAssembly in moduleAssemblies)
{
- if (partManager.ApplicationParts.OfType().Any(p => p.Assembly == moduleAssembly))
- {
- continue;
- }
-
- partManager.ApplicationParts.Add(new AssemblyPart(moduleAssembly));
+ partManager.ApplicationParts.AddIfNotContains(moduleAssembly);
}
}
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationPartSorter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationPartSorter.cs
new file mode 100644
index 0000000000..85fc13c840
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationPartSorter.cs
@@ -0,0 +1,167 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Microsoft.AspNetCore.Mvc.ApplicationParts;
+using Volo.Abp.Modularity;
+
+namespace Volo.Abp.AspNetCore.Mvc
+{
+ ///
+ /// This class is used to align order of the MVC Application Parts with the order of
+ /// ABP module dependencies.
+ ///
+ public static class ApplicationPartSorter
+ {
+ public static void Sort(ApplicationPartManager partManager, IModuleContainer moduleContainer)
+ {
+ /* Performing a double Reverse() to preserve the original order for non-sorted parts
+ */
+
+ var dependencyDictionary = CreateDependencyDictionary(partManager, moduleContainer);
+
+ var sortedParts = partManager
+ .ApplicationParts
+ .Reverse() //First Revers
+ .SortByDependencies(p => dependencyDictionary[p]);
+
+ sortedParts.Reverse(); //Reverse again
+
+ //Replace the original parts with the sorted parts
+ partManager.ApplicationParts.Clear();
+ foreach (var applicationPart in sortedParts)
+ {
+ partManager.ApplicationParts.Add(applicationPart);
+ }
+ }
+
+ private static Dictionary> CreateDependencyDictionary(
+ ApplicationPartManager partManager, IModuleContainer moduleContainer)
+ {
+ var dependencyDictionary = new Dictionary>();
+
+ foreach (var applicationPart in partManager.ApplicationParts)
+ {
+ dependencyDictionary[applicationPart] =
+ CreateDependencyList(applicationPart, partManager, moduleContainer);
+ }
+
+ return dependencyDictionary;
+ }
+
+ private static List CreateDependencyList(
+ ApplicationPart applicationPart,
+ ApplicationPartManager partManager,
+ IModuleContainer moduleContainer)
+ {
+ var list = new List();
+
+ if (applicationPart is AssemblyPart assemblyPart)
+ {
+ AddDependencies(list, assemblyPart, partManager, moduleContainer);
+ }
+ else if (applicationPart is CompiledRazorAssemblyPart compiledRazorAssemblyPart)
+ {
+ AddDependencies(list, compiledRazorAssemblyPart, partManager, moduleContainer);
+ }
+
+ return list;
+ }
+
+ private static void AddDependencies(
+ List list,
+ AssemblyPart assemblyPart,
+ ApplicationPartManager partManager,
+ IModuleContainer moduleContainer)
+ {
+ var dependedAssemblyParts = GetDependedAssemblyParts(
+ partManager,
+ moduleContainer,
+ assemblyPart
+ );
+
+ list.AddRange(dependedAssemblyParts);
+
+ foreach (var dependedAssemblyPart in dependedAssemblyParts)
+ {
+ var viewsPart = GetViewsPartOrNull(partManager, dependedAssemblyPart);
+ if (viewsPart != null)
+ {
+ list.Add(viewsPart);
+ }
+ }
+ }
+
+ private static void AddDependencies(
+ List list,
+ CompiledRazorAssemblyPart compiledRazorAssemblyPart,
+ ApplicationPartManager partManager,
+ IModuleContainer moduleContainer)
+ {
+ if (!compiledRazorAssemblyPart.Name.EndsWith(".Views"))
+ {
+ return;
+ }
+
+ var originalAssemblyPart = GetOriginalAssemblyPartOrNull(compiledRazorAssemblyPart, partManager);
+ if (originalAssemblyPart == null)
+ {
+ return;
+ }
+
+ list.Add(originalAssemblyPart);
+ }
+
+ private static AssemblyPart[] GetDependedAssemblyParts(
+ ApplicationPartManager partManager,
+ IModuleContainer moduleContainer,
+ AssemblyPart assemblyPart)
+ {
+ var moduleDescriptor = GetModuleDescriptorForAssemblyOrNull(moduleContainer, assemblyPart.Assembly);
+ if (moduleDescriptor == null)
+ {
+ return Array.Empty();
+ }
+
+ var moduleDependedAssemblies = moduleDescriptor
+ .Dependencies
+ .Select(d => d.Assembly)
+ .ToArray();
+
+ return partManager.ApplicationParts
+ .OfType()
+ .Where(a => a.Assembly.IsIn(moduleDependedAssemblies))
+ .Distinct()
+ .ToArray();
+ }
+
+ private static CompiledRazorAssemblyPart GetViewsPartOrNull(ApplicationPartManager partManager,
+ ApplicationPart assemblyPart)
+ {
+ var viewsAssemblyName = assemblyPart.Name + ".Views";
+ return partManager
+ .ApplicationParts
+ .OfType()
+ .FirstOrDefault(p => p.Name == viewsAssemblyName);
+ }
+
+ private static AssemblyPart GetOriginalAssemblyPartOrNull(
+ CompiledRazorAssemblyPart compiledRazorAssemblyPart,
+ ApplicationPartManager partManager)
+ {
+ var originalAssemblyName = compiledRazorAssemblyPart.Name.RemovePostFix(".Views");
+ return partManager.ApplicationParts
+ .OfType()
+ .FirstOrDefault(p => p.Name == originalAssemblyName);
+ }
+
+ private static IAbpModuleDescriptor GetModuleDescriptorForAssemblyOrNull(
+ IModuleContainer moduleContainer,
+ Assembly assembly)
+ {
+ return moduleContainer
+ .Modules
+ .FirstOrDefault(m => m.Assembly == assembly);
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs b/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs
index a123236a4e..ec7a640a39 100644
--- a/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs
+++ b/framework/src/Volo.Abp.Core/System/Collections/Generic/AbpListExtensions.cs
@@ -180,7 +180,10 @@ namespace System.Collections.Generic
/// The type of the members of values.
/// A list of objects to sort
/// Function to resolve the dependencies
- ///
+ ///
+ /// Returns a new list ordered by dependencies.
+ /// If A depends on B, then B will come before than A in the resulting list.
+ ///
public static List SortByDependencies(this IEnumerable source, Func> getDependencies)
{
/* See: http://www.codeproject.com/Articles/869059/Topological-sorting-in-Csharp
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
index 8036760f6a..1e5b251ca0 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
@@ -42,6 +43,7 @@ namespace Volo.Abp
services.AddCoreAbpServices(this, options);
Modules = LoadModules(services, options);
+ ConfigureServices();
}
public virtual void Shutdown()
@@ -75,7 +77,7 @@ namespace Volo.Abp
}
}
- private IReadOnlyList LoadModules(IServiceCollection services, AbpApplicationCreationOptions options)
+ protected virtual IReadOnlyList LoadModules(IServiceCollection services, AbpApplicationCreationOptions options)
{
return services
.GetSingletonInstance()
@@ -85,5 +87,75 @@ namespace Volo.Abp
options.PlugInSources
);
}
+
+ //TODO: We can extract a new class for this
+ protected virtual void ConfigureServices()
+ {
+ var context = new ServiceConfigurationContext(Services);
+ Services.AddSingleton(context);
+
+ foreach (var module in Modules)
+ {
+ if (module.Instance is AbpModule abpModule)
+ {
+ abpModule.ServiceConfigurationContext = context;
+ }
+ }
+
+ //PreConfigureServices
+ foreach (var module in Modules.Where(m => m.Instance is IPreConfigureServices))
+ {
+ try
+ {
+ ((IPreConfigureServices)module.Instance).PreConfigureServices(context);
+ }
+ catch (Exception ex)
+ {
+ throw new AbpInitializationException($"An error occurred during {nameof(IPreConfigureServices.PreConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
+ }
+ }
+
+ //ConfigureServices
+ foreach (var module in Modules)
+ {
+ if (module.Instance is AbpModule abpModule)
+ {
+ if (!abpModule.SkipAutoServiceRegistration)
+ {
+ Services.AddAssembly(module.Type.Assembly);
+ }
+ }
+
+ try
+ {
+ module.Instance.ConfigureServices(context);
+ }
+ catch (Exception ex)
+ {
+ throw new AbpInitializationException($"An error occurred during {nameof(IAbpModule.ConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
+ }
+ }
+
+ //PostConfigureServices
+ foreach (var module in Modules.Where(m => m.Instance is IPostConfigureServices))
+ {
+ try
+ {
+ ((IPostConfigureServices)module.Instance).PostConfigureServices(context);
+ }
+ catch (Exception ex)
+ {
+ throw new AbpInitializationException($"An error occurred during {nameof(IPostConfigureServices.PostConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
+ }
+ }
+
+ foreach (var module in Modules)
+ {
+ if (module.Instance is AbpModule abpModule)
+ {
+ abpModule.ServiceConfigurationContext = null;
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs
index 374e1adb78..7e7e69d457 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs
@@ -20,7 +20,6 @@ namespace Volo.Abp.Modularity
var modules = GetDescriptors(services, startupModuleType, plugInSources);
modules = SortByDependency(modules, startupModuleType);
- ConfigureServices(modules, services);
return modules.ToArray();
}
@@ -89,75 +88,6 @@ namespace Volo.Abp.Modularity
return module;
}
- protected virtual void ConfigureServices(List modules, IServiceCollection services)
- {
- var context = new ServiceConfigurationContext(services);
- services.AddSingleton(context);
-
- foreach (var module in modules)
- {
- if (module.Instance is AbpModule abpModule)
- {
- abpModule.ServiceConfigurationContext = context;
- }
- }
-
- //PreConfigureServices
- foreach (var module in modules.Where(m => m.Instance is IPreConfigureServices))
- {
- try
- {
- ((IPreConfigureServices)module.Instance).PreConfigureServices(context);
- }
- catch (Exception ex)
- {
- throw new AbpInitializationException($"An error occurred during {nameof(IPreConfigureServices.PreConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
- }
- }
-
- //ConfigureServices
- foreach (var module in modules)
- {
- if (module.Instance is AbpModule abpModule)
- {
- if (!abpModule.SkipAutoServiceRegistration)
- {
- services.AddAssembly(module.Type.Assembly);
- }
- }
-
- try
- {
- module.Instance.ConfigureServices(context);
- }
- catch (Exception ex)
- {
- throw new AbpInitializationException($"An error occurred during {nameof(IAbpModule.ConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
- }
- }
-
- //PostConfigureServices
- foreach (var module in modules.Where(m => m.Instance is IPostConfigureServices))
- {
- try
- {
- ((IPostConfigureServices)module.Instance).PostConfigureServices(context);
- }
- catch (Exception ex)
- {
- throw new AbpInitializationException($"An error occurred during {nameof(IPostConfigureServices.PostConfigureServices)} phase of the module {module.Type.AssemblyQualifiedName}. See the inner exception for details.", ex);
- }
- }
-
- foreach (var module in modules)
- {
- if (module.Instance is AbpModule abpModule)
- {
- abpModule.ServiceConfigurationContext = null;
- }
- }
- }
-
protected virtual void SetDependencies(List modules, AbpModuleDescriptor module)
{
foreach (var dependedModuleType in AbpModuleHelper.FindDependedModuleTypes(module.Type))
diff --git a/framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs b/framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs
index 93e2ef5824..9c8926f38a 100644
--- a/framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs
+++ b/framework/test/Volo.Abp.Core.Tests/System/Collections/Generic/AbpListExtensions_Tests.cs
@@ -1,5 +1,6 @@
using System.Linq;
using Shouldly;
+using Volo.Abp;
using Xunit;
namespace System.Collections.Generic
@@ -171,5 +172,36 @@ namespace System.Collections.Generic
list[1].ShouldBe(42);
list[2].ShouldBe(3);
}
+
+ [Fact]
+ public void SortByDependencies()
+ {
+ var dependencies = new Dictionary
+ {
+ {'A', new[] {'B', 'G'}},
+ {'B', new[] {'C', 'E'}},
+ {'C', new[] {'D'}},
+ {'D', new char[0]},
+ {'E', new[] {'C', 'F'}},
+ {'F', new[] {'C'}},
+ {'G', new[] {'F'}}
+ };
+
+ for (int i = 0; i < 3; i++)
+ {
+ var list = RandomHelper
+ .GenerateRandomizedList(new char[] {'A', 'B', 'C', 'D', 'E', 'F', 'G'});
+
+ list = list.SortByDependencies(c => dependencies[c]);
+
+ foreach (var dependency in dependencies)
+ {
+ foreach (var dependedValue in dependency.Value)
+ {
+ list.IndexOf(dependency.Key).ShouldBeGreaterThan(list.IndexOf(dependedValue));
+ }
+ }
+ }
+ }
}
-}
+}
\ No newline at end of file
diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj
index a38a51a16c..17a164e612 100644
--- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj
+++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Volo.Abp.Account.Web.IdentityServer.csproj
@@ -17,10 +17,8 @@
-
-
diff --git a/modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj b/modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj
index 09e4b2cc6f..a77cbad333 100644
--- a/modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj
+++ b/modules/account/src/Volo.Abp.Account.Web/Volo.Abp.Account.Web.csproj
@@ -17,22 +17,18 @@
-
-
-
-
-
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj b/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
index 19d156f10b..3760fa0539 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
+++ b/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
@@ -23,10 +23,8 @@
-
-
diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj b/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj
index 57b87b9e72..e8358805b7 100644
--- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj
+++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj
@@ -20,11 +20,9 @@
-
-
diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj
index 4cad3d9e71..14aa5d167d 100644
--- a/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj
+++ b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj
@@ -23,10 +23,8 @@
-
-
diff --git a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj
index afec611259..013435afda 100644
--- a/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj
+++ b/modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj
@@ -24,14 +24,12 @@
-
-
+
+
-
-
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj
index b4917d34d6..a60c57040e 100644
--- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Volo.Abp.FeatureManagement.Web.csproj
@@ -12,10 +12,8 @@
-
-
diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj b/modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
index 98cdf702d4..f5c9ffc3d4 100644
--- a/modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
+++ b/modules/identity/src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
@@ -16,13 +16,11 @@
-
-
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj
index 2c1e0b290d..3209ee2e20 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Volo.Abp.PermissionManagement.Web.csproj
@@ -13,10 +13,8 @@
-
-
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
index cbf526e751..b37ef515df 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj
@@ -20,10 +20,8 @@
-
-
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml
index d1ac64721f..c1da1f5f10 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/_ViewImports.cshtml
@@ -1,2 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
-@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
\ No newline at end of file
+@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
+@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
+@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
\ No newline at end of file
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj
index 56e6d3cae7..c558ea9637 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj
@@ -13,10 +13,8 @@
-
-
diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj
index d6e31e865c..6ef492c829 100644
--- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj
+++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj
@@ -9,11 +9,9 @@
-
-
diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
index 41e6fc059d..2fa8cee028 100644
--- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
+++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
@@ -20,11 +20,9 @@
-
-