Currently ILLink has a relaxed default that makes a best-effort attempt to continue when it fails to resolve assemblies/types/members. This leads to bugs like #93797. We should consider making the resolution behavior stricter.
Historically, the relaxed behavior (--skip-unresolved true) was useful in combination with assembly-level trimming:
- Shims like mscorlib.dll often had dangling type forwarders
- We would sometimes encounter apps where some unused code path had a dangling type reference
When using aggressive trimming, I don't see any good reason for the relaxed behavior (--skip-unresolved true).
I propose we make the following changes:
- Make the relaxed mode (
--skip-unresolved true) strict for everything but type forwarders.
- Change the default to be strict (
--skip-unresolved false) when using TrimMode=link
I would make the change early in .NET 10 to give us time to respond to breaks. #91007 has additional context describing Unity's use of these options.
@vitek-karas @MichalStrehovsky @dotnet/illink
Currently ILLink has a relaxed default that makes a best-effort attempt to continue when it fails to resolve assemblies/types/members. This leads to bugs like #93797. We should consider making the resolution behavior stricter.
Historically, the relaxed behavior (
--skip-unresolved true) was useful in combination with assembly-level trimming:When using aggressive trimming, I don't see any good reason for the relaxed behavior (
--skip-unresolved true).I propose we make the following changes:
--skip-unresolved true) strict for everything but type forwarders.--skip-unresolved false) when usingTrimMode=linkI would make the change early in .NET 10 to give us time to respond to breaks. #91007 has additional context describing Unity's use of these options.
@vitek-karas @MichalStrehovsky @dotnet/illink