2
votes

I wrote several plugin for previous CRM versions, most of them using Early Bound entities.

Right now I am writing a plugin for version 2015 with just one custom entity; the plugin contains the generated entity definition (early-bound entity class).

As soon as I attempt to retrieve an entity using the Organization Service in the Plugin Pipeline I get the following exception:

Element 'http://schemas.microsoft.com/xrm/2011/Contracts:Entity' contains data from a type that maps to the name 'http://schemas.microsoft.com/xrm/2011/Contracts:new_TestEntity'. 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 'new_TestEntity' and namespace 'http://schemas.microsoft.com/xrm/2011/Contracts'.

Plugin has a ProxyTypesAssembly attribute.

I am attempting to intercept the RetrieveMultiple and Retrieve messages. It's all working. It faults as soon as I attempt to execute a Retrieve within the plugin execution context (using the pipeline's org service).

1
Is the code in multiple libraries and - if yes - do you use ILMerge? Can you share the stack trace? Your problem sounds familiar; trying to remember when I had this issue and how I solved it... - Henk van Boeijen
I am not using ILMerge. I only exported those classes I needed from crmsvcutil and included them into the plugin source. - Raine

1 Answers

0
votes

Looks like you have changed your entity model without regenerating the early bound classes. Try regenerating your early bound entities.

Looks like the same issue as described in CRM 2015 SDK : The deserializer has no knowledge of any type that maps to this name