fengling-gateway/.planning/quick/001-upgrade-platform/001-SUMMARY.md
movingsam 42b8c9cca5 fix: 升级 Fengling.Platform 包并修复编译警告
- 修复 CS0108: GatewayDbContext.Tenants 隐藏继承成员
- 修复 NU1506: 移除重复 PackageVersion 定义
- 修复 NU1507: 添加包源映射配置 (NuGet.Config)
2026-03-04 13:14:26 +08:00

42 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Quick Task 001 Summary: 升级 Fengling.Platform 包并修复编译警告
## 任务概述
升级 fengling-gateway 项目中的 Fengling.Platform.Infrastructure 包引用,并修复编译警告。
## 变更内容
### 1. 修复 CS0108 警告
**文件**: `src/yarpgateway/Data/GatewayDbContext.cs`
**问题**: `GatewayDbContext.Tenants` 隐藏了继承的成员 `PlatformDbContext.Tenants`
**修复**: 添加 `new` 关键字明确表示新定义
```csharp
// 修复前
public DbSet<GwTenant> Tenants => Set<GwTenant>();
// 修复后
public new DbSet<GwTenant> Tenants => Set<GwTenant>();
```
### 2. 修复 NU1506 重复 PackageVersion
**文件**: `src/yarpgateway/Directory.Packages.props`
**问题**: 重复定义了 Microsoft.AspNetCore.Authentication.JwtBearer、Microsoft.EntityFrameworkCore.Design、Microsoft.EntityFrameworkCore
**修复**: 移除重复的 PackageVersion 定义
### 3. 修复 NU1507 多个包源警告
**文件**: 根目录创建 `NuGet.Config`
**问题**: 配置了多个包源gitea、nuget.org需要包源映射
**修复**: 添加 packageSourceMapping 配置到 NuGet.Config并删除子目录中的重复配置
## 构建结果
- ✅ 0 错误
- ✅ CS0108 警告已修复
- ✅ NU1506 警告已修复
- ✅ NU1507 警告已修复
- ⚠️ MSB3277 警告EntityFrameworkCore.Relational 版本冲突)- 来自测试项目依赖,不影响构建
## 相关文件
- `src/yarpgateway/Data/GatewayDbContext.cs` - 添加 new 关键字
- `src/yarpgateway/Directory.Packages.props` - 移除重复包版本
- `src/yarpgateway/Directory.Build.props` - 添加包源映射
- `tests/Directory.Build.props` - 添加包源映射
- `NuGet.Config` - 新建包源映射配置