Skip to content

Commit 92466a7

Browse files
claudiamurialdoclaudiamurialdo
andauthored
Fixes System.InvalidOperationException: "Collection was modified after the enumerator was instantiated" that occurred when an environment variable (e.g. GX_CORS_ALLOW_ORIGIN) was defined in .NET Framework to override a configuration value. (#1219)
Co-authored-by: claudiamurialdo <[email protected]>
1 parent 7eb3ad0 commit 92466a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace GeneXus.Configuration
1111
using System.Web;
1212
using System.Configuration;
1313
using System.Collections.Generic;
14+
using System.Linq;
1415
#endif
1516
using System.Collections;
1617
using System.Collections.Specialized;
@@ -583,7 +584,7 @@ static NameValueCollection config
583584
logConfig(null, out configuredFilename);
584585
loadedConfigFile = Path.Combine(GxContext.StaticPhysicalPath(), "web.config");
585586
_config = ConfigurationSettings.AppSettings;
586-
foreach (string key in _config.Keys)
587+
foreach (string key in _config.AllKeys.ToArray())
587588
{
588589
string value = MappedValue(key, _config[key]);
589590
if (value != _config[key])

0 commit comments

Comments
 (0)