You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a plugin-style assembly located in /data/data/.../<apk name>/files/<assembly name>.dll, that is copied to an asset folder before build and marked as "AndroidAsset" (later copied to that directory on target device).
Loading it dynamically at runtime through Assembly.LoadFrom results in a BadImageFormatException.
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Apologies, it seems like the problem was due to a corrupted file from a bad copying (using StreamReader/Writer seems like a bad idea for binary files).
Issue has been resolved, going to close it.
Description
I have a plugin-style assembly located in
/data/data/.../<apk name>/files/<assembly name>.dll
, that is copied to an asset folder before build and marked as "AndroidAsset" (later copied to that directory on target device).Loading it dynamically at runtime through Assembly.LoadFrom results in a BadImageFormatException.
My suspicion is that the related native code that produces the error is around here: https://github.com/dotnet/runtime/blob/c788546f9ad43ea17981d5dc9343b00b6f76d98f/src/coreclr/vm/assemblynative.cpp#L200-L208
Steps to Reproduce
net8.0-android
AndroidAsset
(<AndroidAsset Include="Assets\plugins\**\*" />
)AssetManager
andStreamReader/Writer
)Assembly.LoadFrom
callLink to public reproduction project repository
No response
Version with bug
8.0.61 SR6.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14 (API 34)
Did you find any workaround?
None at the moment. Tried exporting the library for
linux-arm64
architecture, same problem.Relevant log output
The text was updated successfully, but these errors were encountered: