.NET SDK
库多目标 net5.0;net8.0;net10.0(AI 相关包除外)。消费方项目至少使用其中一个目标框架。
| 目标框架 | 角色 |
|---|---|
net5.0 | 兼容产品线中仍在运行的老项目 |
net8.0 | 当前 LTS,推荐的生产基线 |
net10.0 | 最新 LTS,面向新项目 |
SDK 版本由仓库根 global.json 固定:
{ "sdk": { "version": "10.0.300", "rollForward": "latestFeature", "allowPrerelease": false }}NuGet
包发布到 NuGet.org,公开消费无需额外 feed 配置。
# 确认能搜索到包dotnet nuget list sourcedotnet add package Bitzsoft.Integrations.Payment.All如果项目使用集中包管理(CPM),在 Directory.Packages.props 中添加版本即可。
开发工具
| 工具 | 用途 |
|---|---|
| Visual Studio 2022 17.10+ 或 Rider | 日常开发 |
dotnet CLI | 构建、打包、测试 |
dotnet user-secrets | 本地密钥管理(Options 中的 AppId/AppSecret) |
构建
# 克隆仓库后构建全部包git clone https://github.com/shbitz/Bitzsoft.Integrations.gitcd Bitzsoft.Integrationsdotnet restoredotnet build --configuration Release预期结果:0 warning、0 error(警告被 TreatWarningsAsErrors 提升为错误)。
打包
dotnet pack -c Release -o artifacts/打包产物在 artifacts/ 下,包含 .nupkg(主包)和 .snupkg(符号包)。