我有点没有主意了。使用以下代码,我尝试实例化一个大于 2GB 的字节数组:
var b = Array.CreateInstance(typeof(byte), uint.MaxValue);
每次都会引起System.ArgumentOutOfRangeException异常,并显示以下消息arrays larger then 2GB are not supported。
我的 App.config 目前如下:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
</runtime>
</configuration>
此外,该项目的目标平台是x64
如果有任何想法,我将不胜感激。如果有任何信息丢失,我会尽快更新问题。
更新1
我也尝试过uint.MaxValue
GCT1015
不负相思意
相关分类