iron_dot_json - grcodemonkey/iron_sharp GitHub Wiki

IRON.JSON

File Layouts

Basic iron.json file

{
  "project_id": "PROJECT ID HERE",
  "token": "YOUR TOKEN HERE"
}

iron.json file with product override

{
  "project_id": "GLOBAL PROJECT ID",
  "iron_cache": {
    "project_id": "IRONCACHE ONLY PROJECT ID"
  }
}

iron.json file with environment names

{
  "production": {
    "token": "AAAAAAAAAAAAAAAAAAAAAAAAAAA",
    "project_id": "000000000000000000000001"
  },
  "staging": {
    "token": "BBBBBBBBBBBBBBBBBBBBBBBBBB",
    "project_id": "000000000000000000000002"
  },
  "development": {
    "token": "CCCCCCCCCCCCCCCCCCCCCCCCCC",
    "project_id": "000000000000000000000003"
  },
  "test": {
    "token": "DDDDDDDDDDDDDDDDDDDDDDDDDD",
    "project_id": "000000000000000000000004"
  }
}

File Locations


.iron.json


.iron.json - The Global Config

Place a file named .iron.json in your home directory (NOTE the leading ".")

How do I find my home directory?

  1. %userprofile%
  2. WIN+R, type ".", hit enter
  3. Usually here -> c:\users{your_user_name}

iron.json app settings


Place a file named iron.json in the root of your application.

  • For IIS websites this is the site root
  • For any *.exe application, this is the Executing Assembly directory
  • Any settings specified here will override any settings specified in the .iron.json file
  • You can call IronDotConfigManager.SetAppDirectory("path") to specify the directory for the iron.json file.