Q/A

Coordinator
Oct 30, 2011 at 9:41 PM

Please post any questions regarding the library here and I will do my best to post answers regularly.

Oct 10, 2013 at 2:49 AM
Hi, Can we read the configuration from web.config for a web project instead of app.config? Please reply
Coordinator
Oct 10, 2013 at 7:41 AM
That should work fine since it should just pick up on Sent from my iPhone
Oct 10, 2013 at 8:12 AM
cchamberlain wrote:
That should work fine since it should just pick up on Sent from my iPhone
Hi, Appreciate your quick response. It's throwing an error as below.

The 'XrmLibrary' section was not included in the application config file. This section is required by the XrmLibrary.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: XrmLibrary.Exceptions.XrmLibraryException: The 'XrmLibrary' section was not included in the application config file. This section is required by the XrmLibrary.

Appreciate your help.

Thanks,
Coordinator
Oct 10, 2013 at 1:46 PM
Would you be able to post up your config minus any app settings or connection strings? Sounds like something might be messed up in the module definition at the top. Sent from my iPhone
Oct 11, 2013 at 10:51 AM
Please find below web.config settings


<?xml version="1.0"?>
<!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
<section name="xrmLibrary" type="XrmLibrary.ConfigFile.XrmLibraryConfigSection, XrmLibrary" />
</configSections>

<xrmLibrary>
<crmServiceConfigurations>
  <!-- Format: <add CrmOrganizationUrl="<OrganizationServiceUrl>" DiscoveryServiceUrl="<DiscoveryServiceUrl>(Optional)" CrmAuthenticationType="<AD/IFD/Passport>" CrmUserName="********" CrmPassword="********" /> -->
  <add name="crm2011Instance" crmOrganizationUrl="" crmAuthenticationType="AD" crmUserName="administrator" crmPassword="" />
</crmServiceConfigurations>
</xrmLibrary>
<!-- This section contains the log4net configuration settings --> <log4net>
<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"/>
  </layout>
</appender>
<!-- Setup the root category, add the appenders and set the default level -->
<root>
  <level value="INFO"/>
  <appender-ref ref="LogFileAppender"/>
</root>
</log4net>



<system.web>
    <compilation debug="false" targetFramework="4.0" />
</system.web>
</configuration>
Jun 8, 2015 at 8:13 PM
Hi,

I'm implemented a CRM 2011 portal in C#, and trying to accommodate ~500 concurrent users. I've tried implementing the XRMLibrary but am running into issues. I've tried a couple of different ways (getting the org service from the pool and replacing it afterwards as in your UPDATE 12/20/2012, and also tried just doing using(var service = Services.Instance.OrganizationService).

I wrote a test app that hits the my repository classes with 100 concurrent users (using the System.Threading.Tasks.Parallel library) and an getting various different kinds of errors (closed connections, etc). I'm wondering if you have an example of using this library for a higher load situation like I have. I'm assuming I'm just doing something incorrectly.

Maybe we can even talk offline and I can send you examples of what I am doing?

Thanks!