Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 2 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
We are having a performance issue in our CRM 2011 due to no of concurrent instances created for IOrganizationService service.
We have CRM 2011 installed with IFD ADFS configuration. There are around 100 users using the CRM application.
Our client will organize and manage Events in CRM.
We have a separate web portal for allowing public users to register for the events in CRM. Its a ASP.NET web application with forms authentication. The portal will create an instance of IOrganizationService and retrieve the events from CRM and display in the portal. Then the user will select some events and click the submit to register for the events. the registration is recorded in CRM. So all the retrieve, cerate, update is happening through IOrganizationService instance.
Now the problem is when the no if users using the portal is high the portal becomes very slow or even sometimes throw an error when creating an instance for IOrganizationService. It throws error as "Metadata contains a reference that cannot be resolved". This happens only when the no of users using the portal is very high. This also affects the CRM application performance.
Please advice on how to proceed with this issue. I knew IOrganizationService is not thread safe so for each update, create, delete new instance is created for a single session. So for 5000 users there will be 20,000 instances of IOrganizationService created approximately. Is this the correct way to handle the IOrganizationService. Is there any limit for the no of instances for IOrganizationService. As I said after certain limit the application throws error while initiating the IOrganizationService object. The application is accessible intermittently. Please help of how to resolve the issue.
Hi - the Xrm.Client library is designed for portals and uses connection pooling for performance - see my blog series - develop1.net/.../MicrosoftXrmClient-Part-1.aspx
Hope this answers your question?
We are using this method to create instance of Organization Service. How to use connection pool here.
Uri OrganizationURI = new Uri(ConfigurationManager.AppSettings["OrganizationUri"]);
string publicCode = ConfigurationManager.AppSettings["Code"];
string Username = ConfigurationManager.AppSettings.Get("UserName");
string Password = ConfigurationManager.AppSettings.Get("Password");
string Domain = ConfigurationManager.AppSettings.Get("Domain");
ClientCredentials _Credential = new ClientCredentials();
_Credential.UserName.UserName = Username + "@" + Domain;
_Credential.UserName.Password = Password;
using (OrganizationServiceProxy _serviceProxy = new OrganizationServiceProxy(OrganizationURI, null, _Credential, _Credential))
// This statement is required to enable early-bound type support.
_service = (IOrganizationService)_serviceProxy;
You can't connection pool using the OrganizationServiceProxy - you need to use the Microsoft.Xrm.Client library
using (OrganizationService proxy = new OrganizationService(CrmConnection.Parse(connectionString)))
This worked for me.
static CrmConnection crmConnect = CrmConnection.Parse(@"ServiceUri=https://CRMHost;Username=crmuser;Password=password;");
crmConnect.ProxyTypesEnabled = true;
crmConnect.Timeout = new TimeSpan(0, 0, 60, 0);
OrganizationService orgService = new OrganizationService(crmConnect);
Since my portal is open to public users many users will be using parallel. To achieve the scalability how should I inititate the CRM connection. Do I need to initiate the CRMConnection as static so that the connection is initiated only once and shared for all users to create instance of OrganizationService.
1. Declare CrmConnection as static and initiate once for the app domain.
2. New instance of OrganizationService will be created for each operation but will use the Shared CrmConnection to create instance.
Is this correct or do I need to create a new CrmConnection for each user logged into our portal?
Business Applications communities