When working with GemFire .NET native client, there are different ways available to configure system-level properties/attributes. However, it can cause conflicting definitions. Applications can be configured programmatically which have priority over other settings.
In case an attribute is defined in more than one place, the first source in this list is used:
The geode.properties files and programmatic configurations are optional. If they are not present, no warnings or errors occur. Please refer to the documentation for more information: https://docs.vmware.com/en/Native-Client-for-VMware-GemFire/index.html
This knowledge article emphasizes specifically how to use the geode.properties file using IIS Express (for developers testing from Visual Studio 2017 and later) and regular IIS hosted .NET web applications for production-level deployments.
Assuming you have a local or remote GemFire cluster running and you have access to it. Also assuming you know the locators with their port numbers which are to be configured under the cache.xml file. This way, you can also avoid adding the GemFire system properties from the web.config for your session state application. However, you will still need to add a region attribute with a value for your region that holds the session state.
This is strictly for developer’s testing purposes from Visual Studio.
1. Make sure to create and place a cache.xml file under any folder like below and add the properties for the connection pool:
2. Then create a geode.properties file and place it under the installation/working directory of IIS Express. Notice the system-level properties specified that also includes the above cache.xml file
When a Web Application is running through IIS express, GemFire native client considers IIS Express as a working directory and searches for the geode.properties file. Then loads and connects to the server using the properties mentioned in that file.
These steps assume you have appropriate permissions on your Windows operating system to install IIS if required, copying the files anywhere with admin privileges, etc.
1. Assuming you have published your web application from Visual Studio (2017 or later) or from your command line build tools. Once the build is ready, create a website under IIS and map it to the physical directory of build/publish output
2. Create a geode.properties file with attributes to configure GemFire client
If you are using the cache.xml file, you can add the cache-xml-file property and put the absolute path to that file.
3. Place the geode.properties file under the folder where GemFire Native Client libraries (Pivotal.GemFire.dll and Pivotal.GemFire.Session.dll) are located for 10.2. Place this under a subdirectory called “defaultSystem”. The native client library folder can be any location of your choice. So this will be considered as a working directory for Native Client as mentioned at the beginning of this article ([native-client-installation-directory]/).
4. Now the most important step is to create a system Environment Variable called GEODE_NATIVE_HOME with a value to the path where the GemFire native client DLLs are located. You can create it using a command-line tool
5. Finally, restart the IIS and browse your web application
Note: If you come across where a log file that is not getting created at the defined path per "log-file" property defined under geode.properties or in your web.config; to resolve this, make sure you have assigned the necessary read & write permission for ASP.NET User on your Windows Server machine.