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
{{ message }}
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
At present, tools/jnimarshalmethod-gen only builds against the net472 target framework. For .NET 5 support, we believe that we'd need to port this utility to run on .NET 5, and at present that would be by porting to the netcoreapp3.1 target framework.
Unfortunately, .NET Core currently doesn't support AssemblyBuilder.Save(): dotnet/runtime#15704
We will need to investigate if it's even possible to port jnimarshalmethod-gen.exe to .NET Core and .NET 5, assuming that the above issue is not fixed. (Note: above issue was opened in 2015…)
AssemblyBuilderAccess.RunAndSave is specified when the assembly is created. The assembly code is used immediately, and the assembly is also saved to disk so that it can be examined with Ildasm.exe (IL Disassembler) or used in another program.
This suggests that we can migrate jnimarshalmethod-gen.exe to net5 or net6…
…except their own example is using AssemblyBuilder.Save()! This is not particularly encouraging…
When I faced this exact issue on another project, I did a bit of research and it appears that one of the few workarounds is to use something like https://github.com/Lokad/ILPack.
Although I'm not quite sure if it can serve as a reliable drop-in workaround for jnimarshalmethod-gen
Activity
jonpryor commentedon Jul 21, 2021
While
AssemblyBuilder.Save()andAssemblyBuilderAccess.Saveno longer exist, there is anAssemblyBuilderAccess.RunAndSavevalue, and theAssemblyBuilderdocs do mention the ability to save IL to disk:This suggests that we can migrate
jnimarshalmethod-gen.exeto net5 or net6……except their own example is using
AssemblyBuilder.Save()! This is not particularly encouraging…jonpryor commentedon Jul 21, 2021
…oh, and
AssemblyBuilderAccess.RunAndSavedoesn't actually exist:Nope, still no workaround. Plus, obsolete docs!
NickAcPT commentedon Jul 22, 2021
When I faced this exact issue on another project, I did a bit of research and it appears that one of the few workarounds is to use something like https://github.com/Lokad/ILPack.
Although I'm not quite sure if it can serve as a reliable drop-in workaround for
jnimarshalmethod-gen[tests] Add net6.0 TargetFramework. (#888)
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base
[Java.Base-Tests] Test Java-to-Managed invocations for Java.Base (#975)
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions (#…
[Java.Interop.Tools.Expressions] Add Java.Interop.Tools.Expressions (#…