Today while working on one of the queryexpression code in my project I faced this issue.
Error Details
Message=The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException message was 'Error in line 1 position 1836. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data from a type that maps to the name 'FaultMetadataToCDSAlert:IotAlertStateCode'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'IotAlertStateCode' and namespace 'FaultMetadataToCDSAlert'.'. Please see InnerException for more details.
Source=Microsoft.PowerPlatform.Cds.Client
StackTrace:
at Microsoft.PowerPlatform.Cds.Client.CdsServiceClient.RetrieveMultiple(QueryBase query)
at FaultMetadataToCDSAlert.Program.Main(String[] args) in D:MicrosoftrepoSamplesSamplessrcCreate-Dynamics-EntitiesFaultMetadataToCDSAlertProgram.cs:line 89
C# Code
// build query expression that finds the Iot Alert with the Hash value supplied in the fault QueryExpression queryExpression = new QueryExpression() { Distinct = false, EntityName = DynamicsEntities.IoTAlert, ColumnSet = new ColumnSet(IoTAlertProperties.MsdynAlertToken), Criteria…
View original post 120 more words