0
Answered

Microsoft.Crm.Sdk.Messages.QueryExpressionToFetchXmlResponse cannot be cast

Carol Wapshere 7 years ago in UNIFYBroker/Microsoft Dynamics CRM updated by anonymous 7 years ago 3

After updating the CRM SDK DLLs one out of six CRM connectors will not import with the error below. The failing connector is for a custom object type, however four of the successful connectors are also importing custom object types.

I have re-produced this in both the Dev and Test environments.

Change detection engine import all items for connector DAMS User started.",Normal
20170831,23:30:23,UNIFY Identity Broker,Change detection engine,Error,"Change detection engine import all items failed.
Change detection engine import all items for connector DAMS User failed with reason [A]Microsoft.Crm.Sdk.Messages.QueryExpressionToFetchXmlResponse cannot be cast to [B]Microsoft.Crm.Sdk.Messages.QueryExpressionToFetchXmlResponse. Type A originates from 'Microsoft.Crm.Sdk.Proxy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadNeither' in a byte array. Type B originates from 'Microsoft.Crm.Sdk.Proxy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Program Files\UNIFY Solutions\Identity Broker\Services\Microsoft.Crm.Sdk.Proxy.dll'.. Duration: 00:00:01.3906576
Error details:
System.InvalidCastException: [A]Microsoft.Crm.Sdk.Messages.QueryExpressionToFetchXmlResponse cannot be cast to [B]Microsoft.Crm.Sdk.Messages.QueryExpressionToFetchXmlResponse. Type A originates from 'Microsoft.Crm.Sdk.Proxy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadNeither' in a byte array. Type B originates from 'Microsoft.Crm.Sdk.Proxy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Program Files\UNIFY Solutions\Identity Broker\Services\Microsoft.Crm.Sdk.Proxy.dll'.
   at Unify.Product.IdentityBroker.DynamicsCrmAgent.<ExecuteRead>d__41.MoveNext()
   at Unify.Product.IdentityBroker.DynamicsCrmObjectChangeProcessor.<Transform>d__6.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Unify.Product.IdentityBroker.AuditReadingConnectorDecorator.GetAllEntities(IStoredValueCollection storedValues, CancellationToken cancellationToken)
   at Unify.Product.IdentityBroker.EventNotifierReadingConnectorDecoratorBase`1.GetAllEntities(IStoredValueCollection storedValues, CancellationToken cancellationToken)
   at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.ImportAllChangeProcess()
   at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.RunBase()
   at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()
   at Unify.Product.IdentityBroker.ConnectorJobExecutor.<>c__DisplayClass30_0.<Run>b__0()
   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)",Normal

Answer

Answer
Answered

Hi Carol

I have created a CRM and have been testing this issue, however I have not been able to reproduce. This indicates the cause is an environmental factor common to your test and dev environments.


If you are interested in finding a solution, I would start by deleting the contents of this folder: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root

Otherwise, as long as no other operations are being impacted, leaving the "Log Requests" option off would be enough to avoid the issue.

Under review

The code causing this is only executed when the CRM connector config option "Log Requests" is true. If you don't require this option set for that connector, disable it as a temporary workaround.

Thanks Beau - that resolved the issue.

Answer
Answered

Hi Carol

I have created a CRM and have been testing this issue, however I have not been able to reproduce. This indicates the cause is an environmental factor common to your test and dev environments.


If you are interested in finding a solution, I would start by deleting the contents of this folder: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root

Otherwise, as long as no other operations are being impacted, leaving the "Log Requests" option off would be enough to avoid the issue.