In the case of creating multiple AppDomains in the single Native Client .NET application process, it fails with the log message shown below. This error tends to happen on IIS as the ASP.NET application creates individual AppDomains automatically for each deployed Web Application even if the actual application developer does not intend to create AppDomains explicitly.
Client Side Log Message:
gemfire::Exception: GFCLI_EXCEPTION:System.ArgumentException: Cannot pass a GCHandle across AppDomains.
Set appdomain-enabled=true via the property file or API like the following:
Property file (gfcpp.properties by default): appdomain-enabled=true API (C#): Properties<string, string> prp = Properties<string, string>.Create<string, string>(); prp.Insert("appdomain-enabled", "true"); : CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prp); : Cache cache = cacheFactory.Create();