dotnet / dotnet/linker

Validate XML files during library link

Open
#2,055 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

We should consider having the linker validate XML files embedded in assemblies during library (or sharedframework) link. Specifically, we could:

- Resolve metadata references under feature conditions even if there are no feature settings (though @vitek-karas mentioned a reason this might not be desirable)
- Validate embedded XML even if it's ignored (by --ignore-link-attributes or similar)
- Let the Roslyn analyzer check the XML files during build

@eerhardt in https://github.com/dotnet/runtime/pull/53179#issuecomment-847233179:

> I think it would be better if we caught problems like this in dotnet/runtime, and not upstack in the dotnet/sdk tests. So I'd hope we could use our illink-sharedframework target to verify these kinds of warnings don't happen.

@vitek-karas in https://github.com/dotnet/runtime/pull/53179#issuecomment-847296195:

> Currently if the linker sees a feature switch and it evaluates the condition to false, it will simply skip the entire element. So it doesn't even read the XML in question.
It's a bit tricky to say that everything in the XML should be resolvable all the time. We currently don't use feature switches to "hide" things which are not even there, but somebody might want to do that...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.