Config File

This page documents the sections that must be added to the application config file to be able to be able to use the XrmLibrary and log4net.

Below is a sample config file with all required sections. The CrmServiceConfigurations element supports any number of configurations for integration support when working with multiple instances of Microsoft Dynamics CRM 2011. This config file is setup to roll log files after they reach 100KB in size and will create a new log file every day for ease of archiving. More configurations can be found by viewing the documentation at

<?xml version="1.0"?>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
    <section name="XrmLibrary" type="XrmLibrary.Connections.XrmLibraryConfigSection, XrmLibrary"/>

  <!-- This section contains the XrmLibrary configuration settings. -->
      <!-- Format: <add CrmOrganizationUrl="<OrganizationServiceUrl>" DiscoveryServiceUrl="<DiscoveryServiceUrl>(Optional)" CrmAuthenticationType="<AD/IFD/Passport>" CrmUserName="********" CrmPassword="********" /> -->
      <add CrmOrganizationUrl="https://<CrmServerUrl0>/XRMServices/2011/Organization.svc" CrmAuthenticationType="AD" CrmUserName="********" CrmPassword="********" />
      <add CrmOrganizationUrl="https://<CrmServerUrl1>/XRMServices/2011/Organization.svc" CrmAuthenticationType="IFD" CrmUserName="********" CrmPassword="********" />
      <add CrmOrganizationUrl="https://<CrmServerUrl2>/XRMServices/2011/Organization.svc" CrmDiscoveryUrl="https://<DiscoveryServerUrl2>/XRMServices/2011/Discovery.svc" CrmAuthenticationType="Passport" CrmUserName="********" CrmPassword="********" />

  <!-- This section contains the log4net configuration settings -->
    <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
      <file value="log.txt"/>
      <appendToFile value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <header value="[Header]"/>
        <footer value="[Footer]"/>
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline%exception"/>
    <!-- Setup the root category, add the appenders and set the default level -->
      <level value="INFO"/>
      <appender-ref ref="LogFileAppender"/>

Last edited Oct 26, 2011 at 9:10 PM by cchamberlain, version 4


airrick2 Feb 24, 2013 at 4:15 PM 
for the source that was checked in on Dec 20, 2012 this is what the config should look like (NOTE: camel case not title case);

<section name="xrmLibrary" type="XrmLibrary.ConfigFile.XrmLibraryConfigSection, XrmLibrary" />

<!-- This section contains the XrmLibrary configuration settings. -->
<add name="crm2011Instance" crmOrganizationUrl="" crmAuthenticationType="Passport" crmUserName="***************" crmPassword="************" />