2

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).

raine
  • 817
  • 1
  • 15
  • 26
  • 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 Sep 18 '15 at 19:34
  • I am not using ILMerge. I only exported those classes I needed from crmsvcutil and included them into the plugin source. – raine Sep 19 '15 at 12:13

1 Answers1

0

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

Community
  • 1
  • 1
James Wood
  • 17,286
  • 4
  • 46
  • 89
  • Thanks for your reply. The other question is not about a plugin. I have no issues using early bound entities from standalone applications. – raine Sep 19 '15 at 07:40
  • Are the standalone applications using the same version of early bound classes? If its the issue I think it is the hosting of the code isn't important, it all about the early bound classes not matching what is in CRM. – James Wood Sep 19 '15 at 09:45