Wlniao.XCore 8.0.72

dotnet add package Wlniao.XCore --version 8.0.72
                    
NuGet\Install-Package Wlniao.XCore -Version 8.0.72
                    
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="Wlniao.XCore" Version="8.0.72" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wlniao.XCore" Version="8.0.72" />
                    
Directory.Packages.props
<PackageReference Include="Wlniao.XCore" />
                    
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 Wlniao.XCore --version 8.0.72
                    
#r "nuget: Wlniao.XCore, 8.0.72"
                    
#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 Wlniao.XCore@8.0.72
                    
#: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=Wlniao.XCore&version=8.0.72
                    
Install as a Cake Addin
#tool nuget:?package=Wlniao.XCore&version=8.0.72
                    
Install as a Cake Tool

Wlniao.XCore

GitHub License Package Version Pull Count

Wlniao.XCore 是一个基于 .NET Core 的轻量级开发框架,主要包括配置管理、日志记录、加密解密、缓存管理、HTTP客户端、API结果封装等功能模块提供了从基础工具类到高级功能模块的完整解决方案,帮助开发者快速构建稳定、高效的 .NET 应用程序。

核心功能模块

1. 配置管理 (Config)

  • 支持环境变量和配置文件双重配置
  • 提供加密配置项支持
  • 自动读取 xcore.config 或 xcore.dev.config 配置文件(其中dev.config 文件为开发环境配置文件)

2. 日志系统 (Log)

  • 多种日志输出方式:console、file、loki
  • 支持日志级别控制(debug, info, warn, error, fatal)
  • 可自定义日志提供程序

3. 加密解密 (Encryptor)

  • 支持多种摘要算法:MD5, SHA1, SHA256, SHA512, SM3
  • 支持对称加密:AES, SM4 (ECB/CBC模式)
  • 支持非对称加密:RSA, SM2
  • 支持 HMAC 算法:HmacSHA1, HmacSHA256, HmacSM3

4. 缓存管理 (Caching)

  • 多种缓存实现:memory、redis、file
  • 自动选择最优缓存策略
  • 支持对象序列化缓存

5. 网络客户端 (Net)

  • 简化的 HTTP 请求方法
  • 支持 HTTPS 和自定义证书验证
  • 提供 API 客户端工具

6. API 结果封装 (ApiResult)

  • 统一的 API 响应格式
  • 支持业务状态码和消息
  • 可扩展的数据结构

7. 扩展工具类 (Extend)

  • 字符串、集合、枚举等常用类型扩展方法
  • 数据转换和验证工具
  • 分页处理工具

8. 时间处理工具 (DateTools)

  • 提供Unix时间戳转换功能
  • 支持时区处理和时间格式化
  • 提供GMT/UTC时间转换
  • 支持时间字符串解析和格式化输出

9. XServer 微服务 (XServer)

  • 微服务间通信支持
  • API 签名验证机制
  • 服务注册与发现

ASP.NET Core 集成

Wlniao.AspNetCore

  • ASP.NET Core MVC 扩展
  • Kestrel 服务器配置
  • HTTPS/TLS 支持
  • 自定义中间件支持

Wlniao.OpenApi

  • Swagger API 文档集成
  • API 分组管理
  • 自定义参数注解
  • Knife4UI 前端界面

Wlniao.XCenter

  • 模块化认证服务管理
  • 认证授权服务
  • 微服务协调

安装使用

通过 NuGet 安装

# 安装核心框架
dotnet add package Wlniao.XCore

# 安装 ASP.NET Core 扩展
dotnet add package Wlniao.AspNetCore

# 安装 OpenAPI 支持
dotnet add package Wlniao.OpenApi

# 安装 XCenter 模块化认证服务
dotnet add package Wlniao.XCenter

基本配置

在项目中创建 xcore.config 配置文件:

# 日志配置
WLN_LOG_TYPE=console
WLN_LOG_LEVEL=info

# 缓存配置
WLN_CACHE=memory

# 监听端口
WLN_LISTEN_PORT=5000

# 节点配置
WLN_NODE=api

简单示例

using Wlniao;

// 配置读取
var port = Config.GetConfigs("WLN_LISTEN_PORT", "5000");

// 日志记录
Log.Loger.Info("Application started");

// 时间处理
var now = DateTools.GetNow();
var unixTime = DateTools.GetUnix();
var formattedTime = DateTools.Format(now, "yyyy-MM-dd HH:mm:ss");
var utcTime = DateTools.ConvertToUtc(unixTime);

// 加密操作
var encrypted = Encryptor.Md5Encryptor32("hello world");

// 缓存操作
Cache.Set("key", "value", 3600);
var value = Cache.Get("key");

// HTTP API请求
var response = Net.ApiClient.Get("https://api.example.com/data");

高级功能

1. 微服务通信

框架内置了基于 SM4+SM3 的安全通信机制,支持微服务间的加密通信。

2. API 签名验证

提供完整的 API 签名验证机制,确保接口调用的安全性。

3. 多环境支持

支持开发、测试、生产等多环境配置,通过环境变量或配置文件切换。

4. 扩展性设计

框架采用模块化设计,支持自定义扩展和替换核心组件。

环境要求

  • .NET 6.0 / .NET 7.0 / .NET 8.0
  • Windows/Linux/macOS
  • Redis (可选,用于分布式缓存)

许可证

本项目采用 Apache License 2.0 许可证,详情请见 LICENSE 文件。

贡献

欢迎提交 Issue 和 Pull Request 来改进这个项目。

项目链接

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (15)

Showing the top 5 NuGet packages that depend on Wlniao.XCore:

Package Downloads
Wlniao.XCenter

Wlniao XCore for CoreCLR Framework

Wlniao.WeAPP

WeAPP Extend for Wlniao.XCore

Emi.Toolkit

Package Description

Wlniao.AspNetCore

Wlniao XCore for CoreCLR Framework

Wlniao.Aliyun

Aliyun for Wlniao.XCore

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.72 168 5/13/2026
8.0.71 168 4/21/2026
8.0.70 149 3/31/2026
8.0.69 123 3/31/2026
8.0.68 151 3/31/2026
8.0.67 188 3/25/2026
8.0.66 315 1/14/2026
8.0.65 402 12/24/2025
8.0.64 406 12/6/2025
8.0.63 625 11/24/2025
8.0.62 675 11/19/2025
8.0.61 526 11/11/2025
8.0.60 417 11/8/2025
8.0.59 436 11/6/2025
8.0.58 471 11/5/2025
8.0.57 415 11/1/2025
8.0.56 561 10/29/2025
8.0.55 449 10/29/2025
8.0.54 483 10/9/2025
8.0.53 533 10/7/2025
Loading failed