你如何在 coreCLR 中设置 gcAllowVeryLargeObjects?

rjd*_*eux 6 coreclr asp.net-core

既然没有 a app.config,您如何将 gcAllowVeryLargeObjects 设置为 true 以便您可以分配大数组?

kro*_*nis 4

可以使用相应的环境变量;只需记住使用COMPlus_前缀(例如COMPlus_gcAllowVeryLargeObjects=1)。

您可以在运行 dotnet run 之前从命令行进行设置,或者将其添加到 Visual Studio 中项目属性的环境变量部分(或者可能添加注册表项)。