3

I'm having an issue mapping from a COM object to an object. I believe the problem is that GetType() on the COM object returns System.__ComObject. How can I get around this?

Missing type map configuration or unsupported mapping.

Mapping types:
Recipient -> RecipientModel
Microsoft.Office.Interop.Outlook.Recipient -> MyApp.Forms.Models.RecipientModel

Destination path:
RecipientModel

Source value:
System.__ComObject
The Muffin Man
  • 19,585
  • 30
  • 119
  • 191
  • did you ever find a solution for this? – Steve Jun 08 '16 at 21:47
  • I ended up just making my own mapping method that mapped it manually. – The Muffin Man Jun 08 '16 at 23:03
  • That is what I have done also as I do not completely understand the answer in the github thread. But the Example they are using in the thread is for outlook and they made it work. I am waiting for one of them to answer a question there for more clarification. – Steve Jun 09 '16 at 00:25

1 Answers1

0

This was brought up on the AutoMapper Repo and the solution is to map to only the COM class implementing the interface or just cast when mapping.

Steve
  • 25,806
  • 2
  • 33
  • 43