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 模块化,多租户框架。

posted @   LineZero  阅读(13210)  评论(12编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
点击右上角即可分享
微信分享提示