Furion 6.0.0-preview.8

This is a prerelease version of Furion.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Furion --version 6.0.0-preview.8
                    
NuGet\Install-Package Furion -Version 6.0.0-preview.8
                    
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="Furion" Version="6.0.0-preview.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Furion" Version="6.0.0-preview.8" />
                    
Directory.Packages.props
<PackageReference Include="Furion" />
                    
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 Furion --version 6.0.0-preview.8
                    
#r "nuget: Furion, 6.0.0-preview.8"
                    
#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 Furion@6.0.0-preview.8
                    
#: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=Furion&version=6.0.0-preview.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Furion&version=6.0.0-preview.8&prerelease
                    
Install as a Cake Tool

Furion

一切皆插件 · 热插拔 · 自动发现 · 安装即生效 · 卸载零残留

简介

Furion 是 ASP.NET Core 的运行时插件基础设施,让功能以插件形式独立交付,无需修改宿主代码。

功能可按客户、版本或场景组合。新能力以插件发布,问题插件可单独停用或回退。

插件可独立开发、构建、升级与发布。Furion 不改变 ASP.NET Core 编程模型,只在其上提供插件运行时基础设施。

特性

  • 一切皆插件:功能按客户、版本或场景拆分为插件。
  • 热插拔:安装、启用、停用、重载、升级与卸载均在运行时完成。
  • 自动发现:插件放入即被识别,无需手工登记。
  • 安装即生效:安装后即可用,无需重新发布宿主。
  • 卸载零残留:移除后恢复干净状态,不留下残余。
  • 隔离边界:插件之间按边界隔离,单个插件异常不会扩散到宿主。
  • 多形态交付:后端接口、前端资源、独立站点与进程服务均可插件化。
  • 统一工具链:创建、打包、安装、升级、诊断与重启,一套工具完成。
  • 开放扩展:插件只依赖公开契约,内外部团队与第三方生态均可参与。

架构

        ┌──────────────────────────────────────────┐
        │              ASP.NET Core 宿主            │
        └───────────────────┬──────────────────────┘
                            │ AddFurion() + UseFurion()
        ┌───────────────────▼──────────────────────┐
        │               Furion(大脑)              │
        │   发现 / 装载 / 激活 / 调用 / 通讯 / 卸载  │
        └─────────┬───────────────────────┬────────┘
                  │                       │
   ┌──────────────▼───────────┐  ┌────────▼─────────────────┐
   │   Furion.Abstractions    │  │     Furion.Hosting       │
   │   插件契约(唯一依赖)     │  │   宿主侧扩展契约          │
   └──────────────┬───────────┘  └──────────────────────────┘
                  │
        插件(进程内运行或独立进程)
包 角色 谁引用
Furion ASP.NET Core 运行时插件微内核,让插件在运行中安装、启停、升级和卸载,无需修改宿主代码 宿主
Furion.Abstractions 插件作者依赖的公开契约包,涵盖接口、模型、选项、清单和错误码 宿主、插件作者
Furion.Hosting 宿主扩展所需的契约包,覆盖插件管理面、受管重启、包签名和观测 宿主扩展、管理面

默认路由:

  • 宿主端点与静态资源继续走宿主原有路由。
  • 普通插件端点在 /{RoutePrefix}/{pluginId} 下,默认前缀为 /furion。
  • 管理槽插件挂在 /furion,根前端槽插件挂在宿主根 /,两个全局槽各只允许一个活跃占位。

环境要求

  • .NET 11 SDK(global.json 固定 11.0.100)
  • 可选:Node.js 24.21.0 + pnpm 11.22.0,仅构建管理控制台前端时需要

快速开始

1. 运行样例宿主

git clone https://gitee.com/dotnetchina/Furion.git
cd Furion

dotnet run --project backend/samples/Furion.Samples.Host

样例宿主默认监听 http://127.0.0.1:5120。开发环境会自动发现并加载仓库里的源码插件,样例插件启动后即可访问:

http://127.0.0.1:5120/furion/plugin-demo/Demo/hello

返回 hello from plugin-demo 说明宿主编译、插件发现与接口调用链路都已正常。

2. 打开管理控制台

管理控制台由官方插件 furion-sandbox 提供,首次使用需要先构建前端:

cd frontend/sandbox
pnpm install
pnpm build
pnpm deploy:wwwroot
cd ../..

dotnet run --project backend/samples/Furion.Samples.Host

浏览器打开 http://127.0.0.1:5120/furion。首次启动会播种管理员:用户名和随机初始口令写入插件数据目录的 initial-admin.json,启动横幅会打印路径。首次登录必须先自助改密,登录成功后文件被删除。生产环境不会自动建号。

生产首次部署时,管理控制台与身份插件必须随宿主分发,或预先放入宿主程序目录下的 furion-bundled/。管理面尚未就绪时,不能用命令行工具安装这两个插件。

3. 接入自己的宿主

安装 NuGet 包:

dotnet add package Furion

从源码使用时,在宿主工程中直接引用运行时工程:

<ItemGroup>
  
  <ProjectReference Include="..\furion\backend\framework\Furion\Furion.csproj" />
</ItemGroup>

然后在 Program.cs 中加两行:

using Furion;

var builder = WebApplication.CreateBuilder(args);
builder.AddFurion();

var app = builder.Build();
app.UseFurion();
app.Run();

也可以一行启动:FurionApp.Run();。

4. 写第一个插件

插件只引用 Furion.Abstractions,不引用 Furion 运行时。下面的最小示例包含工程文件、清单、入口和控制器:目标框架为 net11.0,引用契约包,并把 furion-plugin.json 配置为随程序集复制到输出目录。

furion-plugin.json:

{
  "$schema": "https://furion.net/schemas/furion-plugin.schema.json",
  "id": "hello-plugin",
  "name": "示例插件",
  "version": "1.0.0",
  "entry": "HelloPlugin.dll"
}

入口实现 IFurionPlugin:

using Furion.Plugins.Registry;
using Furion.Plugins.Scope;

namespace HelloPlugin;

public sealed class Plugin : IFurionPlugin
{
    public Task StartAsync(IFurionPluginContext context, CancellationToken cancellationToken = default)
        => Task.CompletedTask;

    public Task StopAsync(IFurionPluginContext context, CancellationToken cancellationToken = default)
        => Task.CompletedTask;
}

控制器直接按原生 ASP.NET Core 写法,路由会自动收进插件前缀:

using Microsoft.AspNetCore.Mvc;

namespace HelloPlugin.Controllers;

[ApiController]
[Route("[controller]")]
public sealed class HelloController : ControllerBase
{
    [HttpGet("hello")]
    public string Hello() => "hello from hello-plugin";
}

开发期把插件输出目录交给样例宿主即可直接加载,不需要打包:

$env:FURION_DEVELOPER_PLUGINS = "C:\work\HelloPlugin\bin\Debug\net11.0"
dotnet run --project backend/samples/Furion.Samples.Host

然后访问 http://127.0.0.1:5120/furion/hello-plugin/Hello/hello。

对外分发时用 furion 命令行工具打包:

dotnet build -c Release
furion pack -s bin/Release/net11.0 -o hello-plugin.fpkg

furion 来自 Furion.Tool 包(源码在 backend/tools/Furion.Tool),可执行 dotnet tool install -g Furion.Tool 安装。

插件形态

形态 清单关键字段 运行方式
运行时入口型 shape: "inProcess"(默认)+ entry 从插件包加载并激活,可包含控制器、声明式端点、中间件、后台服务与事件
纯前端型 shape: "frontend" + frontend 没有后端程序集,静态资源挂 /{RoutePrefix}/{pluginId},安装即激活
根前端型 shape: "frontend" + mountAt: "root" + frontend 静态资源挂宿主根 /,全局至多一个活跃占位
进程型 shape: "process" + process.command 由独立子进程运行,宿主把请求转发给它,适合进程级隔离或其他语言实现

命令行

统一命令行工具 furion(包名 Furion.Tool):

命令 作用
furion new 用模板生成插件工程
furion pack 把插件输出目录打成 .fpkg,可加作者签名
furion schema 导出插件清单的结构定义
furion install 安装 .fpkg 到运行中的宿主
furion upgrade 升级已安装插件
furion enable / disable 启用或停用已安装插件
furion reload 热重载已启用插件
furion uninstall 卸载插件,默认保留数据目录
furion diagnose 诊断插件卸载后的残留
furion restart 请求宿主受管重启,完成待重启清理

面向运行中宿主的命令需要管理面访问令牌。所有子命令支持 --json 单行输出,便于脚本集成。

官方插件

官方插件是普通插件,按需安装:

  • furion-identity:账号与口令、访问令牌与刷新令牌轮换、登录锁定、权限目录与安全审计。登录 POST /furion/auth/furion-identity/login,当前用户 GET /furion/auth/me。
  • furion-sandbox:管理控制台与插件管理面,声明 mountAt: "admin",界面挂在 /furion,提供插件装卸、运行时配置、宿主健康与观测。

源码位于 backend/plugins/Furion.Identity 与 backend/plugins/Furion.Sandbox。

文档与社区

欢迎通过问题反馈与代码贡献参与 Furion。

版本

当前版本:6.0。

提醒:6.0 当前为预览版,正式版发布前公开接口可能调整。

许可证

Furion 6.0 采用 Mozilla Public License 2.0(MPL-2.0)。版权归百小僧及百签科技(广东)有限公司所有。

你可以自由使用、修改与分发本软件,包括用于商业用途。修改过的 MPL 覆盖文件需继续以 MPL-2.0 公开源码。新增文件与更大作品可以采用其他许可。分发时请保留 LICENSE 与版权声明。

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (64)

Showing the top 5 NuGet packages that depend on Furion:

Package Downloads
Furion.Xunit

Furion Xunit 单元测试扩展插件。

HandeSoft.Core.Abstract

Package Description

HiP.Core

Package Description

Wologic.SYS.Core

公司内部自用

SP.Common.Entity

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Furion:

Repository Stars
monksoul/Furion
让 .NET 开发更简单,更通用,更流行。
f-shake/RemoteFFmpegGUI
使用 Vue.js + ASP.NET + WPF 搭建的 FFmpeg 的 Web + Windows GUI 应用,支持视频转码、拼接等功能
Version Downloads Last Updated
6.0.0-preview.9 0 12/6/2026
6.0.0-preview.8 13 12/5/2026
6.0.0-preview.7 41 12/5/2026
6.0.0-preview.6 50 12/3/2026
6.0.0-preview.5 53 12/3/2026
6.0.0-preview.4 49 12/2/2026
6.0.0-preview.3 72 11/30/2026
6.0.0-preview.2 72 11/29/2026
4.9.9.100 1,206 11/11/2026
4.9.9.99 927 10/28/2026
4.9.9.98 167 10/27/2026
4.9.9.97 311 10/18/2026
4.9.9.96 729 10/13/2026
4.9.9.95 1,186 9/22/2026
4.9.9.94 421 9/19/2026
4.9.9.93 586 9/13/2026
4.9.9.92 2,646 8/31/2026
4.9.9.91 311 8/30/2026
4.9.9.90 176 8/30/2026
4.9.9.89 170 8/29/2026
Loading failed