如何将 System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod 与 CoreCLR 和 CoreFX 一起使用?

How to use System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod with CoreCLR and CoreFX?

我需要 System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod 进行预编译。

但我在 CoreFX 和 CoreCLR 中找不到它的参考 DLL。

我该如何构建它?哪个包有这个 class 和方法??

RuntimeHelpers.PrepareMethod() 在 .Net Core 1.x 中不存在,因此您将无法在那里使用它。

该方法是.Net Core 2.0中添加的,但是it doesn't do anything there

在即将到来的 .Net Core 2.1 中,it will actually compile the given method. (And only the given method。)