Orchard Core 是Orchard CMS的ASP.NET Core版本。 Orchard Core是全新一代的ASP.NET Core CMS。 官方文檔介紹:http://orchardcore.readthedocs.io/en/latest/GitHub: https://githu ...
Orchard Core 是Orchard CMS的ASP.NET Core版本。
Orchard Core是全新一代的ASP.NET Core CMS。
官方文檔介紹:http://orchardcore.readthedocs.io/en/latest/
GitHub: https://github.com/OrchardCMS/OrchardCore
下麵快速開始搭建CMS
新建項目
打開VS2017 新建一個CMSWeb的ASP.NET Core Web應用程式
然後選擇空模板
安裝OrchardCore包
NuGet包命令
Install-Package OrchardCore.Application.Cms.Targets
或者在NuGet搜索 OrchardCore.Application.Cms.Targets
項目開發
打開Startup.cs ,在ConfigureServices加入
services.AddOrchardCms();
然後刪除Configure 中的
app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); });
加入
app.UseModules();
最終如下:
public class Startup { // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddOrchardCms(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseModules(); } }
然後運行程式,打開瀏覽會看到初始化安裝界面。輸入對應信息,然後完成安裝。
註意密碼必須包含大小寫數字和字元才能成功提交。如上圖中出現紅色是不行的。
安裝好後配置一下,最終如下:
後臺為/Admin ,可以進入查看相關設置。
Orchard Core Framework:ASP.NET Core 模塊化,多租戶框架。