Async method detection + platform assembly resolution fixes#326
Merged
Conversation
Adds an "Async Methods" section to `dotnet-inspect library` that lists public
async methods and classifies each as:
- Runtime: .NET 11 runtime async ("async v2"), detected via the
MethodImplAttributes.Async flag (0x2000); no state machine.
- State Machine: classic compiler async ("async v1"), detected via
AsyncStateMachineAttribute / AsyncIteratorStateMachineAttribute.
Mirrors the existing Unsafe/P-Invoke section pattern across the scanner,
presence flags, model, service, view, and section pipeline, with unit tests
(including a PersistedAssemblyBuilder fixture that emits the 0x2000 flag).
Also enables `runtime-async=on` conditionally on net11.0 via a new root
Directory.Build.targets (TargetFramework is not yet set when .props import, so
the condition must live in .targets). This single root targets file also covers
src/** projects, which do not inherit the root Directory.Build.props.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ParseVersion stripped the prerelease suffix before parsing, so multiple side-by-side runtimes sharing a base version (e.g. 11.0.0-preview.3 and 11.0.0-preview.4) collapsed to the same System.Version. "Latest" selection then fell back to directory enumeration order, picking an older preview. Parse with NuGetVersion so prerelease labels order by SemVer precedence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oreLib) ResolveAssembly only checked the shared runtime after finding an assembly in a ref pack. Runtime-only implementation assemblies (System.Private.CoreLib, System.Private.Uri, System.Private.Xml, ...) exist in the shared runtime but have no ref-pack counterpart, so they never resolved as Platform and fell through to a failing NuGet package lookup. Add a shared-runtime fallback to both the bare-name and explicit-framework resolution paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Author
|
Added a second fix in this PR: runtime-only implementation assemblies (e.g. |
…in SKILL/README Cover the new 'Async Methods' library section (Runtime vs State Machine classification) and note that runtime-only platform assemblies such as System.Private.CoreLib now resolve via bare name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ocument -D/-S/--columns/--fields The -x/--exclude option no longer exists; section selection is -S (aliases -s/--select/--section). Update the Common Flags table and Output Control section to reflect the current discovery (-D) and projection (--columns/--fields) model. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related changes to library inspection and platform assembly resolution, plus doc updates.
Async method detection (new feature)
Adds an Async Methods section to
dotnet-inspect library, listing public async methods and classifying each as:MethodImplAttributes.Async(0x2000) flag; no state machine.AsyncStateMachineAttribute/AsyncIteratorStateMachineAttribute.Query with
library X -S "Async*". Mirrors the existing Unsafe/P-Invoke section pattern across scanner, model, service, view, and section pipeline, with unit tests (including aPersistedAssemblyBuilderfixture emitting the 0x2000 flag).Fix: prerelease version ordering
ParseVersionstripped the prerelease label before parsing, collapsing every11.0.0-preview.*runtime toSystem.Version 11.0.0. With equal parsed versions,OrderByDescendingwas a no-op and fell back to directory enumeration order (alphabetical → preview.3 before preview.4), so the tool picked an older preview than the active SDK. Now parses withNuGetVersionfor SemVer-correct precedence.Fix: runtime-only assembly resolution
ResolveAssemblyonly consulted the shared runtime after a ref-pack match. Runtime-only implementation assemblies (System.Private.CoreLib,System.Private.Uri,System.Private.Xml, ...) have no ref-pack counterpart, so they never resolved as Platform and fell through to a failing NuGet lookup. Added a shared-runtime fallback to both the bare-name and explicit-framework paths. Resolves offline (no network).Docs
-x/--excludesection flag; document the current-D/-S/--columns/--fieldsdiscovery-and-projection model.Regression tests added for both resolution fixes; all 35
PlatformResolverTestspass. markdownlint clean.