NeuCharFramework (NCF)
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • Basic Library Source Code Analysis
    • DynamicWebApiEngine
    • Deployment
  • Help

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

    • Preparation
    • Basic Library Source Code Analysis
    • DynamicWebApiEngine
    • Deployment
  • 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
  • Modular Development

    • NCF Modular Development Concept
    • Composition of Xncf
    • Create the First Xncf Module
    • Xncf Module Sample Detailed Explanation
    • Implement Your Own Business Logic
    • Update Xncf Module
    • How to Call Between Modules
    • Publish Xncf Module to nuget.org
    • Update Base Library
    • Xncf Module Development
    • 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

appsettings.json Configuration

Overview

The appsettings.json file contains most of the configuration information for the application and is located in the Senparc.Web directory of the NCF Web template.

The appsettings.json file contains multiple nodes, among which SenparcCoreSetting, SenparcSetting, and SenparcAiSetting are the core configuration nodes of the NCF framework, while other nodes are business configuration nodes of the system.

NodeDescription
SenparcCoreSettingCore configuration node of the NCF framework
SenparcSettingCO2NET global configuration node of the basic framework, used to support underlying capabilities such as caching
SenparcAiSettingSenparc.AI framework AI configuration node, used to support AI capabilities

> The default configuration items can already provide regular operation during the system development phase. Please modify the specific parameter values carefully as needed!

SenparcCoreSetting Node Configuration

Node information is as follows:

  SenparcCoreSetting: {
    IsDebug: true,
    IsTestSite: true,
    DatabaseName: Local, // Corresponding: AppData/DataBase/SenparcConfig.config, the Name prefix of the database connection required in the <SenparcConfig> node
    MemcachedAddresses: ,
    CacheType: Local, // Global cache type, other options see enumeration: Redis / Memcached. For details, see: Senparc.CO2NET.CacheType
    EnableMultiTenant: false, // Whether to enable multi-tenant, please confirm whether the system needs to support multi-tenant when starting for the first time, try not to modify it after deploying to the production environment!
    TenantRule: DomainName, // Distinguish tenant mode
    RequestTempLogCacheMinutes: 5, // Temporary log cache time in the cache (minutes), 0 means no cache
    PasswordSaltToken: YourPasswordSaltToken // Password encryption enhancement option, do not modify this value after the first account is generated, otherwise all passwords will become invalid
  }

Parameter descriptions are as follows:

ParameterDescription
IsDebugWhether it is debug mode. When true, SenparcTrace will record logs (stored in the ~/App_Data/SenparcTraceLog/ directory)

SenparcSetting Node Configuration

ParameterDescription
IsTestSiteWhether it is a test site. This flag is used to run (or prohibit running) certain code in the test environment.
DatabaseNameDatabase name, corresponding to the Name prefix of the database connection required in the <SenparcConfig> node in ~/AppData/DataBase/SenparcConfig.config, default is Local
MemcachedAddressesMemcached connection address, can be ignored if not used
CacheTypeGlobal cache type, other options see enumeration: Local / Redis / Memcached. For details, see: Senparc.CO2NET.CacheType
EnableMultiTenantWhether to enable multi-tenant, please confirm whether the system needs to support multi-tenant when starting for the first time, try not to modify it after deploying to the production environment!
TenantRuleDistinguish tenant mode, default is DomainName, which distinguishes tenants based on domain names
RequestTempLogCacheMinutesTemporary log cache time in the cache (minutes), 0 means no cache
PasswordSaltTokenPassword encryption enhancement option, do not modify this value after the first account is generated, otherwise all passwords will become invalid

Node information is as follows:

    SenparcSetting: {
    // The following are the global configurations of CO2NET's SenparcSetting, do not modify the key, do not delete any items

    IsDebug: true,
    DefaultCacheNamespace: NcfDefaultCache,

    // Distributed cache
    Cache_Redis_Configuration: #{Cache_Redis_Configuration}#, // Redis configuration

    Cache_Memcached_Configuration: #{Cache_Memcached_Configuration}#, // Memcached configuration
    SenparcUnionAgentKey: #{SenparcUnionAgentKey}# // SenparcUnionAgentKey
  },

Parameter descriptions are as follows:

SenparcAiSetting Node Configuration

//Senparc.AI Settings
SenparcAiSetting: {
  IsDebug: true,
  AiPlatform: UnSet, // Note to modify to the corresponding enumeration value of your platform
  NeuCharAIKeys: {
    ApiKey: <Your ApiKey>, // Apply at https://www.neuchar.com/Developer/AiApp
    NeuCharEndpoint: https://www.neuchar.com/<DeveloperId>/, // You can see the DeveloperId when viewing the ApiKey
    ModelName: {
      Chat: gpt-35-turbo,
      Embedding: text-embedding-ada-002,
      TextCompletion: text-davinci-003
  }
}

Node information is as follows:

ParameterDescription
IsDebugWhether it is debug mode. When true, SenparcTrace will record logs (stored in the ~/App_Data/SenparcTraceLog/ directory)
DefaultCacheNamespaceDefault cache namespace. The namespace will help distinguish multiple running NCF projects in the same shared cache service (such as Redis or local Memory cache), ensuring that even if there are the same keys in each system, they will not interfere with each other
Cache_Redis_ConfigurationRedis connection string configuration, if not used, please keep it as is
Cache_Memcached_ConfigurationMemcached connection string configuration, if not used, please keep it as is
SenparcUnionAgentKeySystem Agent key, used for subsequent intelligent networking system expansion
Edit this page on GitHub
Last Updated:
Contributors: JaneConan, Jeffrey Su
Prev
Database Settings
Next
Docker