SBX - Search With Button

SBX - Forum Post Title

CRM 2013 Error in '/XRMServices/2011/Discovery.svc'

Microsoft Dynamics CRM Forum

Nirvana115 asked a question on 2 Jul 2014 6:44 AM
My Badges

Question Status

Verified

Hi All,

I have Error in Service CRm 2013 :

----------------------------
Metadata contains a reference that cannot be resolved: 'http://serveur:5555/_common/error/errorhandler.aspx?BackUri=&ErrorCode=&Parm0=

The service '/XRMServices/2011/Discovery.svc' cannot be activated due to an exception during compilation.  The exception message is: The value could not be added to the collection, as the collection already contains an item of the same type: 'System.ServiceModel.Description.ServiceMetadataBehavior'. This collection only supports one instance of each type.
Parameter name: item.&RequestUri=/XRMServices/2011/Discovery.svc?wsdl&user_lcid=1036'.

i have One Site binding :

Error Log :

WebHost failed to process a request.
 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/45653674
 Exception: System.ServiceModel.ServiceActivationException: The service '/XRMServices/2011/Discovery.svc' cannot be activated due to an exception during compilation.  The exception message is: The value could not be added to the collection, as the collection already contains an item of the same type: 'System.ServiceModel.Description.ServiceMetadataBehavior'. This collection only supports one instance of each type.
Parameter name: item. ---> System.ArgumentException: The value could not be added to the collection, as the collection already contains an item of the same type: 'System.ServiceModel.Description.ServiceMetadataBehavior'. This collection only supports one instance of each type.
Parameter name: item
   at System.Collections.Generic.KeyedByTypeCollection`1.InsertItem(Int32 index, TItem item)
   at Microsoft.Crm.Extensibility.SdkServiceEndpointBuilder.AddMetadataBehavior(ServiceHost serviceHost)
   at Microsoft.Crm.Extensibility.SdkServiceEndpointBuilder.BuildEndpoints(ServiceHost serviceHost, Type implementedContract, Func`1 messageInspectorFactory)
   at Microsoft.Crm.Sdk.V5.DiscoveryServiceHost.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
 Process Name: w3wp
 Process ID: 19628

Any one have solution.

Thanks For All.

Reply
Aileen Gusni responded on 2 Jul 2014 10:16 AM
My Badges
Suggested Answer

Hi, 

Need you to check have you set the URL in the CRM Deployment Manager correctly?

Reply
Suggested Answer

Hi,

Have you made any changes to the CRM website web.config? It looks like you might need to run a repair on your server.

Scott

Reply
Nirvana115 responded on 2 Jul 2014 2:27 PM
My Badges

Hi AILEEN,

I have the correct URL in the CRM Deployment.

Serveur:5555

Hi SCOTT,

i don't change anything in the CRM website web.cong.

And i run repair in my server, but i have the same probleme.

Thanks for all member.

Reply
Arpita Saini responded on 3 Jul 2014 3:37 AM
My Badges

Try following steps and see if it fixes the issue:-

1. Login to CRM Server as Deployment Administrator.

2. Navigate to X:\Program Files\Microsoft Dynamics CRM\CRMWeb\

Note: X is the Drive in which System Files of CRM is saved

3. Open Web.Config file in notepad or any text-editor software and navigate to below tag in Web.Config

<system.serviceModel>

 <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="True" />

</system.serviceModel>

Note: Please take backup of Web.Config file before any modification.

4. For property multipleSiteBindingsEnabled, change the value to False or remove the property.

5. Save the changes and close Web.Config File

6. Perform IISRESET as Deployment Administrator

Note: Perform Step 6 in your Off Business hours as logged in users will be logged out from CRM and would need to log back in.

Reply
Nirvana115 responded on 3 Jul 2014 3:51 AM
My Badges

Hi ARPITA,

Thanks for your replay.

I do the solution but it doesn't work.

Thanks.

Reply
Nirvana115 responded on 3 Jul 2014 5:14 AM
My Badges
Verified Answer

Hi All members.

I found the solution :

1- Backup DB organisation CRM.

2- Uninstall CRM.

3- Install the CRM + Rollup. ( IF your organization is deploying with the latest rollup, you require to install the latest rollup to import the organization ).

4- Restor DB Organisation.

5- Import my Organisation.

The problem is resolu and CRM Work.

thanks For all.

Reply
Arpita Saini responded on 3 Jul 2014 5:38 AM
My Badges

Amazing!

Thanks for the update. Closing this thread as it is resolved now!

Reply
Nirvana115 responded on 3 Jul 2014 5:41 AM
My Badges

Hi ARPITA,

Thanks for your replay.

Yes Yes Yes it resolved, you can closing this thread.

Thanks

Reply
RahulGupta1307 responded on 12 Jun 2015 8:42 AM
My Badges
Suggested Answer

What the worst solution I've ever seen.

The above error caused because of .net framework mismatch.

stackoverflow.com/.../could-not-load-type-system-runtime-compilerservices-extensionattribute-from-as

Microsoft has moved some methods of .net 4.0 to another class in .net 4.5 which caused the above issue.

If you have developed on .net framework 4.5 and deployed at an environment having .net framework 4.0,this error will occur.Just install .net framework 4.5

Reply
billybonkers responded on 7 Sep 2017 3:57 AM
My Badges
Suggested Answer

I think this problem is because you have multiple https bindings setup in IIS for the Dynamics CRM web site.  You can only have one https binding, otherwise the web services won't work.

See the following 2 links:

community.dynamics.com/.../143623

yellowduckguy.wordpress.com/.../microsoft-dynamics-crm-2011-error-when-browsing-discovery-svc-service

I believe Arpita's solution of adding  multipleSiteBindingsEnabled="True" to the web.config would only work for http, it won't solve the problem if you are using https.

Nirvana115's solution of backing up the database, doing a complete reinstall and restore seems a bit drastic, time consuming and unnecessary.

Reply
Nirvana115 responded on 3 Jul 2014 5:14 AM
My Badges
Verified Answer

Hi All members.

I found the solution :

1- Backup DB organisation CRM.

2- Uninstall CRM.

3- Install the CRM + Rollup. ( IF your organization is deploying with the latest rollup, you require to install the latest rollup to import the organization ).

4- Restor DB Organisation.

5- Import my Organisation.

The problem is resolu and CRM Work.

thanks For all.

Reply
Aileen Gusni responded on 2 Jul 2014 10:16 AM
My Badges
Suggested Answer

Hi, 

Need you to check have you set the URL in the CRM Deployment Manager correctly?

Reply
Suggested Answer

Hi,

Have you made any changes to the CRM website web.config? It looks like you might need to run a repair on your server.

Scott

Reply
RahulGupta1307 responded on 12 Jun 2015 8:42 AM
My Badges
Suggested Answer

What the worst solution I've ever seen.

The above error caused because of .net framework mismatch.

stackoverflow.com/.../could-not-load-type-system-runtime-compilerservices-extensionattribute-from-as

Microsoft has moved some methods of .net 4.0 to another class in .net 4.5 which caused the above issue.

If you have developed on .net framework 4.5 and deployed at an environment having .net framework 4.0,this error will occur.Just install .net framework 4.5

Reply
billybonkers responded on 7 Sep 2017 3:57 AM
My Badges
Suggested Answer

I think this problem is because you have multiple https bindings setup in IIS for the Dynamics CRM web site.  You can only have one https binding, otherwise the web services won't work.

See the following 2 links:

community.dynamics.com/.../143623

yellowduckguy.wordpress.com/.../microsoft-dynamics-crm-2011-error-when-browsing-discovery-svc-service

I believe Arpita's solution of adding  multipleSiteBindingsEnabled="True" to the web.config would only work for http, it won't solve the problem if you are using https.

Nirvana115's solution of backing up the database, doing a complete reinstall and restore seems a bit drastic, time consuming and unnecessary.

Reply

SBX - Two Col Forum

SBX - Migrated JS