Skip to content

Add ILVerify option to validate all metadata references - #132362

Open
pkuyo wants to merge 1 commit into
dotnet:mainfrom
pkuyo:feat-ilverify-96458-validate-metadata
Open

Add ILVerify option to validate all metadata references#132362
pkuyo wants to merge 1 commit into
dotnet:mainfrom
pkuyo:feat-ilverify-96458-validate-metadata

Conversation

@pkuyo

@pkuyo pkuyo commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #96458

Adds an opt-in --verify-all-dependencies option to ILVerify.

With this option enabled, ILVerify performs an additional pass over supported metadata references, resolving each one independently so that all failures are reported. (The pass skips P/Invoke ModuleRefs, since they name native libraries rather than managed netmodules.)

Diagnostics use the most specific available error identifier and include metadata tokens when --tokens is specified.
For example, running with both options produces output like this:

[MD]: Error [FileLoadErrorGeneric]: [X.dll][token 0x23000002] Unable to resolve metadata reference (AssemblyReference): Failed to load assembly 'ILVerifyAssemblyThatDoesNotExist'
[MD]: Error [TokenResolve]: [X.dll][token 0x1A000001] Unable to resolve metadata reference (ModuleReference): Assembly or module not found: ILVerifyManagedModuleThatDoesNotExist.netmodule
[MD]: Error [FileLoadErrorGeneric]: [X.dll][token 0x27000001] Unable to resolve metadata reference (ExportedType): Failed to load assembly 'ILVerifyAssemblyThatDoesNotExist'

Tests cover all supported reference kinds, including unused invalid references and valid assembly, type, and managed netmodule references.

@github-actions github-actions Bot added the area-Tools-ILVerification Issues related to ilverify tool and IL verification in general label Aug 15, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 15, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILVerification Issues related to ilverify tool and IL verification in general community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ILVerify] Add option for validation of all dependencies

1 participant