Who should read this article?This article is meant for SaaSGrid developers that have configured their applications to run on their local environment and wish to prepare their application's configuration to run on a live SaaSGrid instance.
IntroductionWhen we develop applications in our local environment, there are many things that need to be configured in order to make the applications work. For example, we need to configure connection strings to contact to the database, we need to reference resources in specific locations, we need to target services in certain areas, etc. The point of SaaSGrid's conditional configuraton system is to allow developers to configure their applications to work in their local environment and at the same time prepare the configuration so that it will work when the applications are deployed on a live SaaSGrid Instance.
SaaSGrid's Conditional Configuration System allows developers to mark XML files (.xml) and configuration files (.config) with specific XML comments to denote sections of XML to be 'swapped' when the configuration goes from a local environment to a live environment. This swap is handled by SaaSGrid at runtime.
Supported File TypesSaaSGrid only supports it's conditional configuration system on certain file types; the following list has a detailed explanation of the file types supported to date:
SamplesThe next block of code shows how your 'App.config' would look like if you were planning on using SaaSGrid's database capabilities and used SaaSGrid's confitional configuration system:
Notice how the only difference between the local configuration and the live configuration is that the local configuration uses the 'System.Data.SqlClient' and the live configuration uses the 'SaaSGrid.Data.SqlClient' but by defining it whith the shown surrounding comment tags, it allows SaaSGrid to make the necessary configuration changes for your applications to run in a live environment while allowing you to develop your application's in a local environment.
The next configuration block shows a sample on how to use SaaSGrid's conditional configuration system to reference a resource by absolute path and the end result after the modifications have been applied.
The end result when this application get's deployed in a live SaaSGrid instance will look like this:
Common ProblemsIt is important that both the opening comment and the closing comment are defined in a SEPARATE LINE and that casing is consistent.