Friday, September 9, 2016

Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies



Exception Messages

File Load Exceptions: "Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)":"Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"


How and When Problem Occurs

It so happen that I referred latest version of Microsoft Dynamic CRM Dll ('Microsoft.Xrm.Sdk) in my project. The version for this DLL is 8.0.0.0.

I forgot to update other Microsoft Dynamic CRM Dll’s (Microsoft.Crm.Sdk.Proxy) in the same project. The version for this DLL is 6.0.0.0.

These DLL’s are dependent on each other and cannot refer to other version of DLL’s at the same time in same project. So there was a mismatch of the version and that’s why CRM platform given File Load Exceptions.


Solution :

When connecting to MS CRM 2016, we need to refer MS CRM 2016 SDK DLL’s with all same version to avoid File Load Exception.

You can download MS CRM 2016 SDK latest DLL from here.

Microsoft.Xrm.Sdk                          version – 8.0.0.0
Microsoft.Crm.Sdk.Proxy                version – 8.0.0.0



Thanks.





Thursday, September 8, 2016

Metadata contains a reference that cannot be resolved: MS CRM (Microsoft Dynamic CRM)

Exception Messages

Metadata contains a reference that cannot be resolved: 'https://************.*******/XRMServices/2011/Organization.svc?wsdl'.

Inner Exception Messages

The remote server returned an error: (407) Proxy Authentication Required.

How and When Problem Occurs

This is generic WCF Service issue, usually occur when a custom application is unable to resolve service references.

The above error is very generic and it could be due to multiple reason, therefore it is advisable to look more into Inner exception details or detail exception data.

Here, we are going to discuss special case about “The remote server returned an error: (407) Proxy Authentication Required.” And this resulted in unable to resolve service reference.

Note : When you are connected on LAN or working in your organization, there may be a possibility  that an organization has set default proxy to avoid access to such services.

Solution :

Try turning off the proxy and check if your application or custom code is able to resolve metadata reference.

If “Yes”, then definitely it’s a proxy issue, and we can edit the config file to provide required authentication.

Add the below tag to avoid proxy issue.               

  <system.net>
    <defaultProxy useDefaultCredentials="true"></defaultProxy>
  </system.net>


Thanks.

Let me know if this does not resolve issue.