Configuration framework based on json.
C#
Switch branches/tags
Nothing to show
Latest commit 5430a31 Nov 11, 2014 @andreazevedo Remove traffic pixel
Permalink
Failed to load latest commit information.
lib/nunit Deserializing json to a dynamic type. Mar 29, 2012
samples Sample web project. Mar 29, 2012
src Unit testing TypeInfo Apr 4, 2012
.gitignore Adding .gitignore for .net Mar 29, 2012
LICENSE.md Added license May 4, 2014
README.md Remove traffic pixel Nov 11, 2014

README.md

JsonConfig

JsonConfig is a simple configuration framework based on json and the dynamic type avaible in .NET Framework 4.0+

Getting Started

  1. In your project, add reference to JsonConfig.dll

  2. Add a file to your project named "app.json.config" with your configuration in a json format. Example:

{
  name: "My Project",
  host: "localhost",
  port: 80
}
  1. If your project is not a web project, you need to set the file to "Copy to the output directory if changed".

  2. Just use the dynamic config object in your code as follows:

Console.WriteLine("name: {0}", JsonConfigManager.DefaultConfig.name);
Console.WriteLine("host: {0}", JsonConfigManager.DefaultConfig.host);
Console.WriteLine("port: {0}", JsonConfigManager.DefaultConfig.port);

Config file

You can use any config file name you want. Checkout the unit tests to find out how.

Licensing

Released under the MIT license.