[NativeAOT] IlcCompileInput ignores ILLink output when RunILLink=true
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
`ComputeIlcCompileInputs` in `Microsoft.NETCore.Native.targets` sets `IlcCompileInput` from `@(IntermediateAssembly)`. When `RunILLink=true` and ILLink runs before ILC, the main assembly in `$(IntermediateLinkDir)` may differ from `IntermediateAssembly` (e.g. due to pre-trimming assembly rewrites). ILC compiles the wrong assembly, causing runtime failures.
The default NativeAOT flow has `RunILLink=false` so this does not arise. Android sets `RunILLink=true` to run custom ILLink steps before ILC.
**Workaround:**
Override `IlcCompileInput` after `ComputeIlcCompileInputs`:
```xml
```
Related: dotnet/android#11183
*This content was created with assistance from AI.*
Contributor guide
Assessment
This issue has not been assessed yet.