【问题标题】:EmitCalli .net core alternativeEmitCalli .net 核心替代方案
【发布时间】:2016-06-30 17:19:01
【问题描述】:

netcoreapp1.0 的 .net 框架 EmitCalli 是否有替代方案

if (IntPtr.Size == 4)
    il.Emit(OpCodes.Ldc_I4, ptr.ToInt32());
else if (IntPtr.Size == 8)
    il.Emit(OpCodes.Ldc_I8, ptr.ToInt64()); 

il.EmitCalli(OpCodes.Calli, CallingConvention.Cdecl, returnType, paramTypes);

【问题讨论】:

    标签: c# .net reflection unmanaged .net-core


    【解决方案1】:

    这个库是否包含您想要的内容?

    https://www.nuget.org/packages/System.Reflection.Emit.ILGeneration/

    它包含 System.Reflection.Emit.ILGenerator 类型,包括函数

    EmitCalli(OpCode opcode, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)

    【讨论】:

    【解决方案2】:

    EmitCalli 将在 .NET Core 2.1.0-preview2+ 中可用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-11
      • 2010-10-16
      • 1970-01-01
      相关资源
      最近更新 更多