Orchard Core一分鍾搭建ASP.NET Core CMS


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包命令 目前預覽版需加 -Pre

Install-Package OrchardCore.Application.Cms.Targets -Pre

或者在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 模塊化,多租戶框架。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM