.net - Mono.Cecil GetTypeReference to ICommand -
the system.windows.input.icommand interface has been type forwarded of .net 4.5 being in presentationcore.dll system.dll. have 2 issues:
how can import interface can use return type of property injecting class (don't need property injection, type resolution/importing)?
how can sure resulting assembly work on .net 4 clients don't have .net 4.5 installed , such not have icommand type forwarded system.dll?
the code intended used in custom fody weaver.
you have handle explicitly.
for example finding action
can exist in diff assemblies.
var mscorelibdefinition = assemblyresolver.resolve("mscorlib"); var mscoretypes = mscorelibdefinition.mainmodule.types; var systemdefinition = assemblyresolver.resolve("system"); var systemtypes = systemdefinition.mainmodule.types; var actiondefinition = mscoretypes.firstordefault(x => x.name == "action"); if (actiondefinition == null) { actiondefinition = systemtypes.first(x => x.name == "action"); }
Comments
Post a Comment