[runtime] If the initial pinvoke lookup fails, emit some code inside the managed-to-native wrapper to retry to lookup on every call until it succeeds. (#40153)
* [runtime] If the initial pinvoke lookup fails, emit some code inside the managed-to-native wrapper to
retry to lookup on every call until it succeeds. Add a cache to prevent further lookups.
This is needed on netcore where pinvoke resolver callbacks can be added any time.
* Fix AOT support.
* Remove debug printf.
* Fix test failures.
* Fix a c++-ism.
12 files changed: