NeuCharFramework (NCF)
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • NcfPackageSources Source Guide
    • DynamicWebApiEngine
    • Deployment
    • MCP (Model Context Protocol) Module
    • Senparc.AI
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • NcfPackageSources Source Guide
    • DynamicWebApiEngine
    • Deployment
    • MCP (Model Context Protocol) Module
    • Senparc.AI
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • NCF Overview

    • NCF - NeuCharFramework
    • About NCF
    • Environment Requirements
    • Frontend and Backend Separation Mode
    • Introduction to Xncf Modules
  • Prepare Development

    • Get NCF Template Source Code
    • Using Visual Studio to Run NCF
    • Running NCF Using CLI
    • Installation
    • Admin Login
    • Admin Backend
    • appsettings.json Configuration
    • Module Management
    • Accessing Documentation
  • Configuration

    • Entry File
    • Database Settings
    • appsettings.json Configuration
    • Docker
    • Dapr
    • Configure Multi-Tenant
    • Redis Cache
  • Template-Based Development

    • NCF Modular Development Concept
    • XNCF Module Structure
    • XNCF Extension Contracts and Boundaries
    • Create the First Xncf Module
    • Current XNCF Template Structure
    • Implement Your Own Business Logic
    • Update Xncf Module
    • How to Call Between Modules
    • Publish Xncf Module to nuget.org
    • Update Base Library
    • Create a Minimal XNCF Module Manually
    • Embedding Static Resource Files into NCF
    • Publish Local Nuget Package
    • Advanced
  • Database

    • Database Settings
    • Multi-Database Support
    • Specify Database
    • Update database migration files for the Senparc.Service project (Migrations)
    • Multi-Database Principle
    • DatabasePlant
    • Tarmac Operation Database Migration and Update
  • Unit Testing

    • NCF Unit Test Introduction
    • Start Development
    • Advanced
    • Appendix
  • Q&A

    • NCF Terminology
    • NCF FAQ
  • Release

    • New Features
    • Upgrade Guide
    • Logs

XNCF Module Structure

This is Template-based development documentation. It describes public module composition and usage contracts without analyzing the internal scanner. The content was checked against Senparc.Xncf.XncfBuilder.Template 0.13.0.

An XNCF is an NCF module unit that can be scanned, installed, enabled, disabled, and governed independently. In most cases, start with the XNCF module generator instead of assembling every component from an empty project.

Minimum module register

Every module needs a [XncfRegister] class that derives from XncfRegisterBase and implements IXncfRegister:

using Senparc.Ncf.XncfBase;

namespace MyOrg.Xncf.Sample;

[XncfRegister]
public partial class Register : XncfRegisterBase, IXncfRegister
{
    public override string Name => "MyOrg.Xncf.Sample";
    public override string Uid => "A-FIXED-GLOBALLY-UNIQUE-GUID";
    public override string Version => "0.1.0";
    public override string MenuName => "Sample";
    public override string Icon => "fa fa-star";
    public override string Description => "Sample XNCF module";
}
  • Name and Uid must be globally unique. Do not change a published Uid.
  • Version is the module lifecycle version, not the NuGet package version.
  • Use InstallOrUpdateAsync() and UninstallAsync() for lifecycle behavior.

Start with XNCF Extension Contracts and Boundaries. Only when debugging the framework implementation should you continue to the IXncfRegister source analysis.

Load order

[XncfOrder(x)] is evaluated in descending order:

  • 0 or unset: regular modules;
  • 1–5000: modules with an explicit relative order;
  • 58xx: reserved for AI foundation modules;
  • 59xx: reserved for system foundation modules.

Business modules should not occupy system-reserved ranges.

Current Function mechanism

Functions are no longer registered through an IXncfRegister.Functions or IXncfFunction list. The framework scans [FunctionRender] methods on AppServiceBase subclasses and records them in the module's FunctionRenderCollection.

Recommended structure:

Application/
  AppServices/       Application services with [FunctionRender]
  DTOs/
    Request/         FunctionAppRequestBase request models
    Response/        Response DTOs

See Create a minimal XNCF module manually.

Optional capabilities

Add only what the module needs:

CapabilityCurrent entry point
Database and migrationsIXncfDatabase, Register.Database.cs
Razor AreaIAreaRegister, Register.Area.cs
Razor runtime compilationIXncfRazorRuntimeCompilation
MiddlewareIXncfMiddleware
Background threadIXncfThread
FunctionAppServiceBase + [FunctionRender]
MCP serverEnableMcpServer => true + MCP tool attributes

Recommended reading order

  1. XNCF Extension Contracts and Boundaries
  2. Create your first XNCF module
  3. Current template structure
  4. Develop an XNCF module
  5. Call between modules
Edit this page on GitHub
Last Updated:
Contributors: Jeffrey Su, JeffreySu
Prev
NCF Modular Development Concept
Next
XNCF Extension Contracts and Boundaries