OSharp.Plugin.Admin 10.0.3

dotnet add package OSharp.Plugin.Admin --version 10.0.3
                    
NuGet\Install-Package OSharp.Plugin.Admin -Version 10.0.3
                    
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.
<PackageReference Include="OSharp.Plugin.Admin" Version="10.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OSharp.Plugin.Admin" Version="10.0.3" />
                    
Directory.Packages.props
<PackageReference Include="OSharp.Plugin.Admin" />
                    
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.0.3
                    
#r "nuget: OSharp.Plugin.Admin, 10.0.3"
                    
#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.0.3
                    
#: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.0.3
                    
Install as a Cake Addin
#tool nuget:?package=OSharp.Plugin.Admin&version=10.0.3
                    
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<MyPluginOptions>(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.0.3 84 1/23/2026
10.0.2 73 1/23/2026
10.0.1 78 1/23/2026
10.0.0 112 1/21/2026
9.0.0 194 8/9/2025
8.2.1 484 12/9/2025
8.2.0 259 12/4/2025
8.1.9 459 11/20/2025
8.1.8 243 10/31/2025
8.1.7 249 10/27/2025
8.1.6 249 9/30/2025
8.1.5 248 9/24/2025
8.1.4 358 9/18/2025
8.1.3 368 9/18/2025
8.1.2 359 9/18/2025
8.1.1 230 9/3/2025
8.1.0 236 5/5/2025
8.0.8.6 200 12/18/2024
8.0.8.5 167 11/27/2024
8.0.8.4 154 11/15/2024
8.0.8.3 167 11/15/2024
8.0.8.2 173 10/21/2024
8.0.8.1 195 10/9/2024
7.0.25 359 8/22/2024
7.0.24 265 8/16/2024
7.0.23 171 8/5/2024
7.0.22 267 7/30/2024
7.0.21 175 7/25/2024
7.0.20 183 7/25/2024
7.0.0 208 6/18/2024