Description
Description
There is a mismatch between the InternalName
and OriginalFilename
values in the assembly and its actual name. While it's expected to be CommandLine.dll
, it is commandline.dll
.
Here are details from the assembly:
�FileVersion2.0.275.0@��InternalNamecommandline.dll(��LegalCopyright H��OriginalFilenamecommandline.dll4��ProductVersion2.0.275<
�Assembly Version2.0.275.0à�Ä6
This mismatch causes a runtime issue in Mono embedding scenarios on apple mobile platforms. When the assembly is referenced by another, it cannot be loaded, resulting in the error:
Failed to load AOT module 'aot-instances' while running in aot-only mode because a dependency cannot be found or it is out of date.
Repro steps
Mismatch in Assembly and OriginalFilename Causes Runtime Issue in Mono Embedding on Apple Mobile Platforms
- Build the repository:
./build.sh mono+libs -os ios -arch arm64
- Compile the tests:
./src/tests/build.sh ci os ios arm64 Debug -mono tree baseservices/mono /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=false /p:LibrariesConfiguration=Debug /bl
Workaround
If the assembly is not used, the parameter /p:PublishTrimmed=true
should be passed to remove the assembly from the app bundle.
An alternative is to pass the --aot-lazy-assembly-load
runtime parameter, which shouldn't load all referenced assemblies during the startup. However, if the the referenced assembly is used, the runtime will abort because these kinds of errors can only be handled when loading the AOT image, not later.