Troubleshooting tips

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

The following information is provided as an aid in diagnosing certain common issues that may arise when developing Microsoft Dynamics 365 SDK based applications. More content will be added to this topic as time goes on.

For more information about enabling tracing in an on-premises Microsoft Dynamics 365 server, see TechNet: Monitor and troubleshooting Microsoft Dynamics CRM.

Handle the MessageSecurityException exception when you use the Dynamics 365 web services

When you use the Dynamics 365 APIs to connect to the Microsoft Dynamics 365 (online) organization or discovery services you could receive the following exception:

Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

To fix this, you can try deleting the device registration folder named LiveDeviceID in your profile folder C:\Users\<username>. Then, try to connect again.

Exceptions that can occur when running CrmSvcUtil

When you run the CrmSvcUtil.exe tool to generate early-bound entity types, you might receive an exception with the following message.

The type initializer for Microsoft.Xrm.Client.CodeGeneration.CodeCustomization threw an exception.

This error can be caused if the build version of the CrmSvcUtil tool and Microsoft.Xrm.Client.CodeGeneration.dll assembly aren’t the same. When you develop applications using the Microsoft Dynamics 365 SDK, always use the CrmSvcUtil tool and assemblies that are provided in the Bin folder of the SDK. Download the Microsoft Dynamics CRM SDK package. Don’t use the tool or assemblies from the Tools folder of a Microsoft Dynamics 365 server installation.

See Also

Troubleshooting and error handling
Web service error codes

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright