Configo.Client.NetFramework 0.0.2

dotnet add package Configo.Client.NetFramework --version 0.0.2
                    
NuGet\Install-Package Configo.Client.NetFramework -Version 0.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Configo.Client.NetFramework" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Configo.Client.NetFramework" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Configo.Client.NetFramework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Configo.Client.NetFramework --version 0.0.2
                    
#r "nuget: Configo.Client.NetFramework, 0.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Configo.Client.NetFramework@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Configo.Client.NetFramework&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Configo.Client.NetFramework&version=0.0.2
                    
Install as a Cake Tool

Configo.Client.NetFramework

A .NET Framework 4.8 client library for integrating with Configo configuration management.

Overview

This library provides a simple way for .NET Framework applications (Web applications, Windows Services, Console apps) to retrieve configuration from a Configo server and automatically populate ConfigurationManager.AppSettings and ConfigurationManager.ConnectionStrings using the standard Microsoft.Configuration.ConfigurationBuilders pattern.

Features

  • ✅ Built on Microsoft.Configuration.ConfigurationBuilders - the standard way to extend configuration in .NET Framework
  • ✅ Automatic population of ConfigurationManager.AppSettings
  • ✅ Automatic population of ConfigurationManager.ConnectionStrings
  • ✅ JSON-based caching for offline support (when Configo server is unavailable)
  • ✅ Declarative configuration via Web.config/App.config
  • ✅ Compatible with .NET Framework 4.8

Installation

Install-Package Configo.Client.NetFramework

Or via .NET CLI:

dotnet add package Configo.Client.NetFramework

Usage

Basic Setup (Web.config or App.config)

Add the Configo configuration builder to your configBuilders section and apply it to appSettings and connectionStrings:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="configBuilders" 
             type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
             restartOnExternalChanges="false" 
             requirePermission="false" />
  </configSections>

  <configBuilders>
    <builders>
      <add name="configoAppSettings" 
           type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
           url="https://your-configo-server.com"
           apiKey="your-api-key-here"
           cacheFileName="appsettings.configo.json" />
      <add name="configoConnectionStrings" 
           type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
           url="https://your-configo-server.com"
           apiKey="your-api-key-here"
           cacheFileName="appsettings.configo.json" />
    </builders>
  </configBuilders>

  <appSettings configBuilders="configoAppSettings">
    
    
  </appSettings>

  <connectionStrings configBuilders="configoConnectionStrings">
    
    
  </connectionStrings>

  
</configuration>

That's it! No code changes needed. The configuration builder will automatically:

  1. Fetch configuration from your Configo server at application startup
  2. Cache it to appsettings.configo.json for offline scenarios
  3. Populate ConfigurationManager.AppSettings and ConfigurationManager.ConnectionStrings

Configuration Builder Attributes

Attribute Required Default Description
url Yes - The Configo server URL
apiKey Yes - The API key for authentication
cacheFileName No appsettings.configo.json Cache file for offline support

Advanced Configuration

Using Environment Variables for API Key

For security, you can use environment variables or other config sources for sensitive values:

<configBuilders>
  <builders>
    <add name="Environment" 
         type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
    <add name="Configo" 
         type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
         url="https://your-configo-server.com"
         apiKey="${CONFIGO_API_KEY}"
         section="AppSettings"
         cacheFileName="appsettings.configo.json" />
  </builders>
</configBuilders>

<appSettings configBuilders="Environment,Configo">
  
</appSettings>
Custom Cache Location
<add name="Configo" 
     type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
     url="https://your-configo-server.com"
     apiKey="your-api-key-here"
     section="AppSettings"
     cacheFileName="C:\ProgramData\MyApp\configo-cache.json" />
Disable Caching

Set cacheFileName to an empty string to disable caching:

<add name="Configo" 
     type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
     url="https://your-configo-server.com"
     apiKey="your-api-key-here"
     section="AppSettings"
     cacheFileName="" />

Accessing Configuration in Code

Once configured, access settings normally through ConfigurationManager:

using System.Configuration;

// AppSettings
var mySetting = ConfigurationManager.AppSettings["MySetting"];
var apiEndpoint = ConfigurationManager.AppSettings["ApiEndpoint"];

// ConnectionStrings
var connString = ConfigurationManager.ConnectionStrings["MyDatabase"].ConnectionString;

Configuration Format

The Configo server should return JSON in the following format:

{
  "AppSettings": {
    "Setting1": "Value1",
    "Setting2": "Value2",
    "ApiEndpoint": "https://api.example.com"
  },
  "ConnectionStrings": {
    "DefaultConnection": "Server=myserver;Database=mydb;Trusted_Connection=true;",
    "CacheConnection": "Server=cache;Database=redis;..."
  }
}

Only the AppSettings and ConnectionStrings sections are processed. Other sections in the JSON will be ignored.

Caching and Offline Support

By default, configuration is cached in appsettings.configo.json in the application's working directory. This cache file is used when:

  • The Configo server is unreachable
  • Network connectivity is lost
  • The Configo server is temporarily down

When using the cache fallback, a warning is written to the trace output.

Error Handling

The configuration builder will throw ConfigurationErrorsException when:

  • Required attributes (url, apiKey) are missing
  • The URL is not a valid absolute URI
  • The Configo server is unreachable and no cache file exists
  • The cache file exists but cannot be parsed

These errors occur during application startup, which is the standard behavior for configuration errors in .NET Framework.

Integration with Other ConfigBuilders

Configo works seamlessly with other configuration builders. You can chain multiple builders:

<configBuilders>
  <builders>
    <add name="Environment" 
         type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
    <add name="Configo" 
         type="Configo.Client.NetFramework.ConfigoConfigurationBuilder, Configo.Client.NetFramework"
         url="https://configo.example.com"
         section="AppSettings"
         apiKey="${CONFIGO_API_KEY}" />
    <add name="UserSecrets" 
         type="Microsoft.Configuration.ConfigurationBuilders.UserSecretsConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.UserSecrets" />
  </builders>
</configBuilders>

<appSettings configBuilders="Environment,Configo,UserSecrets">
  
</appSettings>

Limitations

This is a simplified implementation for .NET Framework with the following limitations compared to the .NET Core version:

  • ✋ No auto-refresh support (configuration is loaded once at startup)
  • ✋ Only supports AppSettings and ConnectionStrings sections
  • ✋ No nested/hierarchical configuration support beyond these sections
  • ✋ No strongly-typed configuration binding (use .NET Core's IOptions<T> for that)

For more advanced scenarios, consider migrating to .NET Core/5+ and using Configo.Client.

Comparison with Configo.Client (.NET Core)

Feature Configo.Client (.NET Core) Configo.Client.NetFramework
Target Framework .NET 6.0+ .NET Framework 4.8
Configuration System IConfiguration ConfigurationManager
Configuration Pattern IConfigurationBuilder ConfigurationBuilders
Setup Code-based Declarative (Web.config/App.config)
Configuration Format Full JSON hierarchy AppSettings + ConnectionStrings only
Auto-refresh ✅ Yes ❌ No
Strongly-typed binding ✅ Yes (IOptions<T>) ❌ No
Caching ✅ Yes ✅ Yes
Integration Microsoft.Extensions.* System.Configuration

Troubleshooting

Configuration builder not loading

  1. Verify the configSections element is at the top of your config file
  2. Check that the type attribute exactly matches the assembly-qualified name
  3. Ensure Configo.Client.NetFramework.dll is in your application's bin directory
  4. Check the Application Event Log for any startup errors

Configo server connection errors

  1. Verify the URL and API key are correct
  2. Check network connectivity to the Configo server
  3. Look for a cached configuration file (appsettings.configo.json)
  4. Check trace output for warnings about cache fallback

Configuration values not appearing

  1. Verify the section uses configBuilders="Configo"
  2. Check that the Configo server is returning data in the correct format
  3. Inspect the cache file to verify the data structure
  4. Enable trace output to see what the builder is doing

License

See the main Configo repository for license information.

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.2 431 11/13/2025
0.0.1 316 11/12/2025