Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
VS 2022 17.8.5
Description
When setting AndroidStripILAfterAOT=true in a test app, some tests are failing the first time we run them, but then they'll pass if we run them again.
The error is 100% reproducible when starting the app again.
Here is the error: InvalidProgramException: Invalid IL code in Xunit.Assert:True(bool): method body is empty.
No issue in Debug. No issue when removing AndroidStripILAfterAOT=true.
This is similar to #104156, but no BroadcastReceiver is involved here.
Steps to Reproduce
- Open repro in visual studio.
- Run app in Release on android emulator.
- Run all tests: one of the test fails.
- Run all tests again: both tests succeed.
Did you find any workaround?
Remove AndroidStripILAfterAOT=true.
Relevant log output
No response