WebEnh

.net7 mvc jquery bootstrap json 学习中 第一次学PHP,正在研究中。自学进行时... ... 我的博客 https://enhweb.github.io/ 不错的皮肤:darkgreentrip,iMetro_HD
随笔 - 1079, 文章 - 1, 评论 - 75, 阅读 - 174万
  首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

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

Posted on   WebEnh  阅读(831)  评论(0编辑  收藏  举报

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

 
分类: ASP.NET Core

 

0
0
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2016-09-23 HTML页面禁止选择、页面禁止复制、页面禁止右键
点击右上角即可分享
微信分享提示

喜欢请打赏

扫描二维码打赏

了解更多