EmitCalli .net核心替代方案

问题描述 投票:3回答:2

对于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
2个回答
4
投票

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

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

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

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


1
投票

EmitCalli将在.NET Core 2.1.0-preview 2中提供

© www.soinside.com 2019 - 2024. All rights reserved.