AutoMapper 4 targeting wrong constructor on instantiation
See original GitHub issueAfter updating to AutoMapper 4, I am receiving an error in a situation that used to work. I have 2 different objects that I am trying to create a mapping for (ImportedContact -> Contact). The destination object (Contact) has 2 constructors, one without parameters and another with 2 reference type parameters (SerializationInfo, StreamingContext). When I try calling Mapper.Map to instantiate a new instance of the destination object (Contact) it is calling the constructor that takes 2 parameters. AutoMapper 3 was using the parameter-less constructor. This causes the following error:
"Missing type map configuration or unsupported mapping.
Mapping types:
ImportedContact -> SerializationInfo
SharePointDirectory.Jobs.ImportedContact -> System.Runtime.Serialization.SerializationInfo
Destination path:
Contact
Source value:
SharePointDirectory.Jobs.ImportedContact"
Here is a link to some files that I have uploaded to Gist that can be put into a Console app and when ran will demonstrate the issue. https://gist.github.com/ristogod/60ac506272bdd519485a
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (4 by maintainers)
Top GitHub Comments
@TylerCarlson1 eleventy.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.