Commit 1be10fa
[Java.Interop.Tools.JavaCallableWrappers] TypeNameMapGenerator directories (#89)
The `TypeNameMapGenerator(IEnumerable<string>, Action<string,object[]>)`
constructor attempted to use `DirectoryAssemblyResolver` to load each
assembly provided by the `IEnumerable<string>` parameter, in-order,
*without* updating `DirectoryAssemblyResolver.SearchDirectories`.
The result is that things would only work if the assemblies were
sorted in "dependency order", e.g. `mscorlib.dll` first, and any other
assembly dependency before it's used.
Should the order be otherwise, e.g. `{System.dll, mscorlib.dll}`, then
things would horrifically break:
System.IO.FileNotFoundException: Could not load assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'mscorlib.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x0015d] in <216e7ad0b70c419890a52554f287cdcd>:0
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00001] in <216e7ad0b70c419890a52554f287cdcd>:0
at Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) [0x0004e] in <4f9b8c8361824d0ca9025449919e12be>:0
at Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) [0x00007] in <4f9b8c8361824d0ca9025449919e12be>:0
at Mono.Cecil.TypeReference.Resolve () [0x00014] in <4f9b8c8361824d0ca9025449919e12be>:0
Improver the `TypeNameMapGenerator` constructor so that
`DirectoryAssemblyResolver.SearchDirectories` is set to contain all
directories for all assemblies provied, *before* attempting to load
any assemblies. This allows assemblies to be provided in an arbitrary
order, while still allowing assemblies to be found.1 parent 084e9f7 commit 1be10fa
File tree
1 file changed
+7
-0
lines changed- src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
| |||
0 commit comments