Configuration file for CRM 3.0 Callouts


In callouts in CRM 3.0, for providing configuration information we used to create our own config file.

The naming convention that we used to follow was


And we used to deploy it at the same location as callout i.e. server/bin/assembly

The structure of the config file used to be

<?xml version=”1.0″ encoding=”utf-8″ ?>

To read the config values in the callout we used to have this following code

string assemblyLocation=System.Reflection.Assembly.GetExecutingAssembly().Location;
string crmUrl=GetConfigValue(assemblyLocation,”crmurl”);

The GetConfigValue function

private static string GetConfigValue(string AssemblyName,string KeyValue)
string Filename=AssemblyName+”.config”;
XmlDocument xmlDoc = new XmlDocument();
XmlNode crmNode = xmlDoc.SelectSingleNode(“//”+KeyValue);
string tagValue=crmNode.InnerText.ToString();
return tagValue;


Actually I was working with callouts after so many months, so thought i should save the above information for future reference!!



Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.