NUnit tests not recognizing gcAllowVeryLargeObjects setting

Viewed 122

I'm using NUnit 3.12, VS 2019, and .Net 4.6.1.

I'm attempting to set the <gcAllowVeryLargeObjects enabled="true"\> setting for NUnit tests via the App.config but it doesn't appear to be registering the config change when actually executing the tests.

Here is my App.config for my Test project:

<configuration>
  <runtime>
    <gcAllowVeryLargeObjects enabled="true" />
  </runtime>
</configuration>

Code that is failing:

[Test]
public void TestLargeAllocation()
{
    var x = new double[18000, 18000];
}

System.OutOfMemoryException Message: "Array dimensions exceeded supported range."

I have verified that the tests.dll.config in the output directory actually contains the config setting:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <gcAllowVeryLargeObjects enabled="true" />
    <assemblyBinding xmlns=...

Any help would be appreciated.

0 Answers
Related