dotnet-inspect-compatibility
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-inspect: compatibility and change analysis
dotnet-inspect: 兼容性与变更分析
Use this skill to decide whether a change is safe to adopt: what changed between
two versions and what surface a library exposes. The scenario crosses commands —
for change, / for the surface a single version exposes.
difflibrarypackagebash
dnx dotnet-inspect -y -- <command>使用该工具判断某项变更是否可以安全采用:查看两个版本之间的差异,以及某个库暴露的接口面。该场景涉及多个命令——用于查看变更,/用于查看单个版本的接口面。
difflibrarypackagebash
dnx dotnet-inspect -y -- <command>Did the API surface change?
API表面是否发生变更?
diffbash
dnx dotnet-inspect -y -- diff --package System.Text.Json@9.0.0..10.0.0 --breaking
dnx dotnet-inspect -y -- diff --platform System.Runtime@9.0.0..10.0.0 --additive
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll --changed--breaking--additive--changed--name-only-t TypeName--alldiffbash
dnx dotnet-inspect -y -- diff --package System.Text.Json@9.0.0..10.0.0 --breaking
dnx dotnet-inspect -y -- diff --platform System.Runtime@9.0.0..10.0.0 --additive
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll --changed--breaking--additive--changed--name-only-t TypeName--allDid runtime behavior change? (allocations, exceptions)
运行时行为是否发生变更?(内存分配、异常)
-S "Analysis Diff"Member | Signal | Old | New | DeltaSignalallocationscopiesreflectionthrowscatchesfinallysunsafeconstructed-exceptionsoptimizationperformancecorrectnessbash
dnx dotnet-inspect -y -- diff --package Foo@1.0.0..2.0.0 -S "Analysis Diff"
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll -S "Analysis Diff" --changedUse for aggregate regression triage. To confirm whether one
allocation occurrence was introduced at a caller-selected boundary, resolve one
method and request the native Analysis Finding pairs:
Analysis Diffbash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.allocationPairFinding.AddedOld=absentNew=presentPresentRemovedChangedFor a direct-call boundary in one caller method, select the call-site producer:
bash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.call-siteRows identify the callees. confirms a new direct-call
occurrence; reports retained-call facet changes such as moving into a
loop.
PairFinding.AddedChangedFor a definite unsafe-operation boundary in one method, select the unsafety
producer:
bash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.unsafetyRows identify unsafe operation kinds and details. confirms
introduction; and distinguish persistence from
disappearance without treating endpoint-local IL offsets as identity.
PairFinding.AddedPresentRemoved-S "Analysis Diff"成员 | 信号 | 旧值 | 新值 | 差异allocationscopiesreflectionthrowscatchesfinallysunsafeconstructed-exceptionsoptimizationperformancecorrectnessbash
dnx dotnet-inspect -y -- diff --package Foo@1.0.0..2.0.0 -S "Analysis Diff"
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll -S "Analysis Diff" --changed使用进行聚合退化问题分类。要确认某个内存分配是否是在调用者指定的边界处引入的,可以解析某个方法并请求原生的Analysis Finding对:
Analysis Diffbash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.allocationPairFinding.AddedOld=absentNew=presentPresentRemovedChanged对于某个调用方法中的直接调用边界,选择调用站点生成器:
bash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.call-site结果行标识被调用方。确认新的直接调用出现;报告保留调用的方面变化,例如移入循环中。
PairFinding.AddedChanged对于某个方法中明确的不安全操作边界,选择不安全操作生成器:
bash
dnx dotnet-inspect -y -- diff --package Foo@1.4.0..1.5.0 \
-t Foo.Parser -m Parse \
--finding analysis.unsafety结果行标识不安全操作的类型和细节。确认新增;和区分持续存在和消失的情况,不会将端点本地的IL偏移视为标识。
PairFinding.AddedPresentRemovedDid the implementation change? (decompiled C# + IL + authored Source)
实现是否发生变更?(反编译C# + IL + 原始源代码)
-S "Implementation Diff"C#ILSourceC#Source-t-m--table--tsv--jsonlbash
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll \
-S "Implementation Diff" --authored-source --repo /path/to/Foo \
-t MyType -m HotPath--reporaw.githubusercontent.com-S "Implementation Diff"C#ILSourceC#Source-t-m--table--tsv--jsonlbash
dnx dotnet-inspect -y -- diff --library old/Foo.dll..new/Foo.dll \
-S "Implementation Diff" --authored-source --repo /path/to/Foo \
-t MyType -m HotPath--reporaw.githubusercontent.comWhat can be configured? (feature switches)
可配置项有哪些?(功能开关)
-S Switcheslibrarypackage --library[FeatureSwitchDefinition]AppContextbash
dnx dotnet-inspect -y -- library System.Text.Json -S Switches在或命令中使用,可查看行为和裁剪/AOT旋钮:、运行时主机配置选项以及开关。
librarypackage --library-S Switches[FeatureSwitchDefinition]AppContextbash
dnx dotnet-inspect -y -- library System.Text.Json -S SwitchesWhich versions to compare
要比较哪些版本
Version resolution is source-scoped. Use for the best-known
listed version: it reuses each source's matching latest entry and queries
sources without one. Use to bypass those caches and
refresh the newest version across all eligible configured sources, and
(add ) to list published versions. Unlisted
versions are hidden unless
is explicit. retains each
version/feed pair when source identity matters. Source declaration order is not
precedence; load the skill for source and credential workflows.
Pin with : , .
Foo --versionFoo --latest-versionFoo --versions [N]--preview--include-unlisted--versions-with-feedprivate-feeds@Foo@9.0.0Foo@latestFor caller-driven onset or bisect work, resolve an inclusive addressable vector,
then probe only the cells you choose:
bash
dnx dotnet-inspect -y -- package Foo@1.0.0..2.0.0 --versions
dnx dotnet-inspect -y -- type TargetType --package Foo@1.0.0..2.0.0 --at '#5'
dnx dotnet-inspect -y -- member TargetType TargetMember --package Foo@1.0.0..2.0.0 --at 1.6.0
dnx dotnet-inspect -y -- timeline --package Foo@1.0.0..2.0.0 \
--type TargetType --members --at first --at last
dnx dotnet-inspect -y -- timeline --package Foo@1.0.0..2.0.0 \
--type TargetType --member TargetMember \
--finding analysis.unsafety --at first --at last--at#NfirstlasttimelineEvaluationsTransitions--at--at--at all--type-presence--members--attributesapi.typeapi.memberapi.attribute--memberapi.memberanalysis.allocationanalysis.call-siteanalysis.unsafetyThe range and point probes identify a candidate boundary. Confirm the adjacent
pair with Metadata's real Finding comparison rather than inferring introduction
from probe text:
bash
dnx dotnet-inspect -y -- diff \
--package System.Text.Json@8.0.6..9.0.0 \
-t System.Text.Json.Schema.JsonSchemaExporter \
-S "Finding Transitions"An introduction boundary is a row with , , and
. means the target exists at both endpoints;
for a type target, no row means it exists at neither. Use for
an API member boundary. Use ,
, or with exactly
one method target for the corresponding Analysis boundary.
Use or with exactly one method target
to inspect native implementation-census transitions. Those lenses preserve
complete, absent, and failed outcomes, including added or removed methods.
PairFinding.AddedOld=absentNew=presentPairFinding.Present-m Type.Member:1--finding analysis.allocation--finding analysis.call-site--finding analysis.unsafety--finding csharp.line--finding il.op版本解析是源范围的。使用获取最知名的列出版本:它会重用每个源的匹配最新条目,并查询没有条目的源。使用绕过这些缓存,刷新所有符合条件的配置源中的最新版本;使用(添加)列出已发布版本。未列出的版本默认隐藏,除非显式使用。当源标识很重要时,会保留每个版本/源对。源声明顺序不代表优先级;加载工具以处理源和凭据工作流。使用固定版本:、。
Foo --versionFoo --latest-versionFoo --versions [N]--preview--include-unlisted--versions-with-feedprivate-feeds@Foo@9.0.0Foo@latest对于调用者驱动的起始点或二分查找工作,解析一个可寻址的向量,然后仅探查你选择的部分:
bash
dnx dotnet-inspect -y -- package Foo@1.0.0..2.0.0 --versions
dnx dotnet-inspect -y -- type TargetType --package Foo@1.0.0..2.0.0 --at '#5'
dnx dotnet-inspect -y -- member TargetType TargetMember --package Foo@1.0.0..2.0.0 --at 1.6.0
dnx dotnet-inspect -y -- timeline --package Foo@1.0.0..2.0.0 \
--type TargetType --members --at first --at last
dnx dotnet-inspect -y -- timeline --package Foo@1.0.0..2.0.0 \
--type TargetType --member TargetMember \
--finding analysis.unsafety --at first --at last--at#NfirstlasttimelineEvaluationsTransitions--at--at--at all--type-presence--members--attributesapi.typeapi.memberapi.attributeapi.member--memberanalysis.allocationanalysis.call-siteanalysis.unsafety范围和点探查可确定候选边界。使用Metadata的真实Finding比较来确认相邻版本对,而非从探查文本中推断引入情况:
bash
dnx dotnet-inspect -y -- diff \
--package System.Text.Json@8.0.6..9.0.0 \
-t System.Text.Json.Schema.JsonSchemaExporter \
-S "Finding Transitions"引入边界是一行、且的结果。表示目标在两个端点都存在;对于类型目标,没有结果行表示它在两个端点都不存在。使用查看API成员边界。对于恰好一个方法目标,使用、或查看对应的Analysis边界。对于恰好一个方法目标,使用或检查原生实现统计的转换。这些视角会保留完整、缺失和失败的结果,包括新增或移除的方法。
PairFinding.AddedOld=absentNew=presentPairFinding.Present-m Type.Member:1--finding analysis.allocation--finding analysis.call-site--finding analysis.unsafety--finding csharp.line--finding il.op