Crping.EFCore.Analyzers 10.7.0

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

Crping.EFCore.Analyzers

Crping.EFCore 升级迁移分析器(Roslyn Analyzer + CodeFixProvider):把 v10 升级的「对照文档手工排查」升级为「编译期诊断 + 一键改写」。Crping.EFCore / Crping.EFCore.Common / Crping.EFCore.Controller 三包以普通依赖引用本包,消费方 restore 后分析器自动加载,无需任何配置。

特性

  • 零运行时依赖:包内仅 analyzers/dotnet/cs 资产(IncludeBuildOutput=false),无 lib 产物、不进运行时依赖图
  • 误报防护:绑定失败降级语法匹配(升级中途源码本就带编译错误)+ IsUnresolved 判定,消费者自有同名属性 / 方法不误报
  • 可逐条关闭:诊断默认 warning,可经 .editorconfig 按规则 ID 关闭;不升 error
  • 版本钉下限:Roslyn 引用(Microsoft.CodeAnalysis.CSharp 4.3.1)钉在消费方 SDK 自带 Roslyn 下限之下,防 CS8032 加载失败

规则一览(CRPEF001~005)

ID 检测目标 迁移指引 CodeFix
CRPEF001 SoftDeleteAsync 第二实参按位置传入 bool——9.x 该位置是 reset(true=恢复),10.x 同位置是 selfOnly(仅本人可见),编译通过但语义完全不同、零警告 具名实参 selfOnly: true/false;恢复改用 ResetSoftDeleteAsync ✅ 具名化 selfOnly:
CRPEF002 委托槽位旧名赋值:.GetCurrentUserId / .GetAuthorization / .GetAuthHeaderValue / .GenerateId(v10.0.0 第四批同族收口改名) CurrentUserIdResolver / AuthorizationResolver / AuthHeaderValueResolver / IdGenerator;控制器侧受保护方法未改名、不受影响 ✅ 一键改名
CRPEF003 bll.Cache 垫片访问(v10.0.0 第三批移除) BLL 侧改用 CacheManager;BaseDomain / IDomain 的 Cache 为有意保留且可解析,不报 ✅ 改 CacheManager
CRPEF004 静态注册表类型与垫片:MethodsEnableRegistry / MethodRouteRegistry / CacheEnableRegistry / RegisterMethodsEnable 等(v10.0.0 第二批下线) AddEFCoreMethodsEnable(...) / AddEFCoreCacheEnable(...)(Crping.EFCore.Controller 命名空间) ❌ 迁移需插 DI 上下文,给建议文案
CRPEF005 ToggleDeleteStatusAsync(BLL 方法 + MethodsEnable 开关属性,v10.0.0 第二批移除) SetDeleteStatusAsync(id, isDeleted)(set 语义,需读当前值再设) ❌ 同上

规则目录以 design/task-5-upgrade-tooling.md §2.2 为唯一真值;编译器已报的错误(CS0246 / CS1061 / CS8852 / CS0115)不重复报。

版本更新说明


10.7.0

2026年10月1日 星期四

首发版本——任务 5 M2(升级 / 迁移成本工具化第二层,minor 升版)

  • CRPEF001~005 五条规则与三条 CodeFix(规则目录见上表)
  • 方案 C 分发:三库普通依赖传递(消费方 restore 即自动获得;不可设 DevelopmentDependency——会阻断资产流动)
  • CI 自举:包发布公共源前,.cnb.yml 以 pack-analyzers 前置 stage 建本地 feed 供三包还原
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Crping.EFCore.Analyzers:

Package Downloads
Crping.EFCore

基于 `EntityFramework Core` 的数据库操作工具包基础类

Crping.EFCore.Common

为 Crping.EFCore 提供接口与公共基类等

Crping.EFCore.Controller

基于 Crping.EFCore 的 WebApi 控制器基类

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.7.0 136 10/1/2026