OSharp.Plugin.Admin 10.1.5

dotnet add package OSharp.Plugin.Admin --version 10.1.5
                    
NuGet\Install-Package OSharp.Plugin.Admin -Version 10.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.

                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.

                    
Directory.Packages.props

                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OSharp.Plugin.Admin --version 10.1.5
                    
#r "nuget: OSharp.Plugin.Admin, 10.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OSharp.Plugin.Admin@10.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OSharp.Plugin.Admin&version=10.1.5
                    
Install as a Cake Addin
#tool nuget:?package=OSharp.Plugin.Admin&version=10.1.5
                    
Install as a Cake Tool

OSharp.Plugin.Core

简洁的插件核心库,提供插件加载、注册与基础扩展点(示例库)。该包主要用于在 .NET 项目中集成插件机制与扩展点。

功能

  • 插件发现与加载
  • 插件生命周期管理
  • 基础扩展点接口与示例实现

安装

从 NuGet 安装(替换为实际包名):

# 使用 dotnet CLI
dotnet add package OSharp.Plugin.Core --version x.y.z

# 使用 NuGet 包管理器控制台
Install-Package OSharp.Plugin.Core -Version x.y.z

using OSharp.Plugin.Core;

// 根据库的实际 API 调整以下示例
var manager = new PluginManager(); // 示例构造
manager.LoadPlugins("Plugins");    // 从指定目录加载插件
manager.InitializeAll();

OSharp.Plugin.Admin

简要说明

OSharp.Plugin.Admin 用于提供系统后台管理相关的 API、控制器、权限与管理页面集成点(插件形式)。该插件封装了项目中与后台管理系统相关的模块:路由、控制器基类、身份/权限扩展以及管理界面所需的服务。

主要功能

  • 后台管理 API 控制器集合(用户、角色、权限等)
  • 系统路由与菜单管理点
  • 与 OSharp 主程序的集成点(可注册为一个 Pack/模块)
  • 示例控制器与权限特性,便于扩展和二次开发

目录结构(概要)

  • Controllers/ —— 后台相关的 MVC/WebAPI 控制器
  • Identity/ —— 身份与权限相关实现(如用户/角色服务)
  • SystemRouterManager.cs —— 系统路由/菜单管理
  • AdminPack / Pack 类 —— 插件对外暴露的注册入口(若存在)

安装与引用

本仓库中插件以项目形式存在(*.csproj),推荐两种集成方式:

  1. 在同一解决方案中以项目引用方式引入

    • 将 OSharp.Plugin.Admin 项目加入到解决方案
    • 在主 Web 项目(如 OSharp.Api)中添加项目引用
    # 在主项目目录执行
    dotnet add reference ../Plugins/OSharp.Plugin.Admin/OSharp.Plugin.Admin.csproj
    
  2. 通过 NuGet(若已发布)

    dotnet add package OSharp.Plugin.Admin --version x.y.z
    

集成到应用

  • 控制器发现 如果插件内包含 MVC 控制器,确保主应用在启动时把插件程序集加入到 MVC 部分:

    services.AddControllers()
            .AddApplicationPart(typeof(SystemRouterManager).Assembly)
            .AddControllersAsServices();
    
  • 服务注册 插件通常会提供一个 Pack/Startup 类用于注册依赖,在主项目的 Startup/Program 中调用该注册方法或将插件程序集扫描到 OSharp 的模块加载中。

配置

  • 插件可能依赖主项目的 appsettings.json 中的配置项(例如权限、菜单、日志相关)。
  • 若有专用配置类,请查阅插件内以 *Setting 或 *Options 结尾的类,并在主项目中将配置绑定到这些类:
services.Configure(Configuration.GetSection("MyPlugin"));

开发与本地调试

  • 本插件使用与主项目相同的 .NET SDK 版本(查看各项目的 TargetFramework)。

  • 本地运行步骤(在主项目根目录或解决方案根):

    1. 确保已引用 OSharp.Plugin.Admin 项目。
    2. dotnet build
    3. dotnet run --project Presentation/OSharp.Api
  • 在调试时,可以把断点设置在插件控制器/ 服务上,IDE 会随着主项目启动而加载插件程序集。

贡献指南

欢迎贡献:

  • 提交 Issue 描述 bug 或提议
  • Fork 仓库 → 新建分支 → 提交 PR(遵循项目的代码风格与单元测试规范)

许可证与版权

详见仓库根目录的 LICENSE 文件(如有)。

联系方式

如需帮助,请在仓库中创建 Issue,或联系项目维护者。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on OSharp.Plugin.Admin:

Package Downloads
OSharp.Plugin.MobileApp

OSharp小程序组件,封装着小程序所需功能

OSharp.Plugin.Mall

OSharp 商城组件,封装着商城功能

OSharp.Plugin.Content

OSharp cms组件,封装着cms功能

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.1.5 118 9/21/2026
10.1.4 120 9/21/2026
10.1.3 151 9/17/2026
10.1.2 126 9/16/2026
10.1.1 168 7/1/2026
10.1.0 206 6/18/2026
10.0.9 130 6/2/2026
10.0.8 163 5/16/2026
10.0.6 157 3/26/2026
10.0.5 158 3/9/2026
10.0.4 176 1/31/2026
10.0.3 171 1/23/2026
10.0.2 165 1/23/2026
10.0.1 171 1/23/2026
10.0.0 173 1/21/2026
8.2.1 539 12/9/2025
8.2.0 315 12/4/2025
8.1.9 504 11/20/2025
8.1.8 292 10/31/2025
8.1.7 300 10/27/2025
Loading failed