Fixed module load order bug. added Bootstrap project.

pull/81/head
Halil İbrahim Kalkan 9 years ago
parent 628a0075ea
commit c723ba0224

@ -90,6 +90,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Volo.Abp.AspNetCore.Embedde
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.UI", "Abp.UI", "{6F776E78-862A-4147-86BA-12B6B64E8958}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", "src\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.xproj", "{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -208,6 +210,10 @@ Global
{B6182BF1-9EC6-403D-A42C-D6441CF7B390}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6182BF1-9EC6-403D-A42C-D6441CF7B390}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6182BF1-9EC6-403D-A42C-D6441CF7B390}.Release|Any CPU.Build.0 = Release|Any CPU
{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C761A3F7-787D-4C7E-A41C-5FAB07F6B774}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -249,5 +255,6 @@ Global
{BF9AB22C-F48D-4DDE-A894-BC28EB37166B} = {6F776E78-862A-4147-86BA-12B6B64E8958}
{B6182BF1-9EC6-403D-A42C-D6441CF7B390} = {4C753F64-0C93-4D65-96C2-A40893AFC1E8}
{6F776E78-862A-4147-86BA-12B6B64E8958} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{C761A3F7-787D-4C7E-A41C-5FAB07F6B774} = {6F776E78-862A-4147-86BA-12B6B64E8958}
EndGlobalSection
EndGlobal

@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.AspNetCore.EmbeddedFiles;
using Volo.Abp.AspNetCore.Modularity;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
@ -16,7 +16,7 @@ namespace AbpDesk.Web.Mvc
{
[DependsOn(
typeof(AbpAspNetCoreEmbeddedFilesModule),
typeof(AbpAspNetCoreMvcUiModule),
typeof(AbpAspNetCoreMvcUiBootstrapModule),
typeof(AbpDeskApplicationModule),
typeof(AbpDeskEntityFrameworkCoreModule))]
public class AbpDeskWebMvcModule : AbpModule

@ -24,7 +24,7 @@
"Volo.Abp.AspNetCore.Mvc": "1.0.0-*",
"AbpDesk.EntityFrameworkCore": "1.0.0-*",
"AbpDesk.Application": "1.0.0-*",
"Volo.Abp.AspNetCore.Mvc.UI": "1.0.0-*",
"Volo.Abp.AspNetCore.Mvc.UI.Bootstrap": "1.0.0-*",
"Volo.Abp.AspNetCore.EmbeddedFiles": "1.0.0-*"
},

@ -0,0 +1,27 @@
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EmbeddedFiles;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
{
[DependsOn(typeof(AbpAspNetCoreMvcUiModule))]
public class AbpAspNetCoreMvcUiBootstrapModule : AbpModule
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddAssemblyOf<AbpAspNetCoreMvcUiBootstrapModule>();
services.Configure<EmbeddedFileOptions>(options =>
{
options.Sources.Add(
new EmbeddedFileSet(
"/Views/",
GetType().GetTypeInfo().Assembly,
"Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Views"
)
);
});
}
}
}

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:61183/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Volo.Abp.AspNetCore.Mvc.UI.Bootstrap": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,22 @@
@using System.Threading.Tasks
@model Volo.Abp.UI.Navigation.ApplicationMenu
<h2>@Model.DisplayName (BOOTSTRAP)</h2>
<ul>
@foreach (var menuItem in Model.Items)
{
<li>
<a href="@menuItem.Url">@menuItem.DisplayName</a>
@if (menuItem.Items.Any())
{
<ul>
@foreach (var childMenuItem in menuItem.Items)
{
<li>
<a href="@childMenuItem.Url">@childMenuItem.DisplayName</a>
</li>
}
</ul>
}
</li>
}
</ul>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c761a3f7-787d-4c7e-a41c-5fab07f6b774</ProjectGuid>
<RootNamespace>Volo.Abp.AspNetCore.Mvc.UI.Bootstrap</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,22 @@
{
"dependencies": {
"Volo.Abp.AspNetCore.Mvc.UI": "1.0.0-*"
},
"tools": {
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
},
"buildOptions": {
"embed": {
"include": [
"Views/**/*.*"
]
}
}
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>

@ -22,7 +22,9 @@ namespace Volo.Abp.Modularity
FillModules(modules, services, startupModuleType, plugInSources);
SetModuleDependencies(modules);
SortByDependency(modules, startupModuleType);
modules = SortByDependency(modules, startupModuleType);
ConfigureServices(modules, services);
return modules.ToArray();
@ -58,11 +60,12 @@ namespace Volo.Abp.Modularity
}
}
protected virtual void SortByDependency(List<AbpModuleDescriptor> modules, Type startupModuleType)
protected virtual List<AbpModuleDescriptor> SortByDependency(List<AbpModuleDescriptor> modules, Type startupModuleType)
{
modules.SortByDependencies(m => m.Dependencies);
modules.MoveItem(m => m.Type == typeof(AbpKernelModule), 0);
modules.MoveItem(m => m.Type == startupModuleType, modules.Count - 1);
var sortedModules = modules.SortByDependencies(m => m.Dependencies);
sortedModules.MoveItem(m => m.Type == typeof(AbpKernelModule), 0);
sortedModules.MoveItem(m => m.Type == startupModuleType, modules.Count - 1);
return sortedModules;
}
protected virtual AbpModuleDescriptor CreateModuleDescriptor(IServiceCollection services, Type moduleType)

Loading…
Cancel
Save