Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing type map configuration or unsupported mapping error when multiple projects reference Heroic.AutoMapper. #15

Open
jbarrineau06 opened this issue May 11, 2017 · 1 comment
Labels

Comments

@jbarrineau06
Copy link

jbarrineau06 commented May 11, 2017

Hello,

I'm having an issue with Heroic.Automapper. When I start my MVC 5 app, it runs the Configure method in AutoMapperConfig.cs, and if I pause and run AutoMapper.Mapper.Configuration.GetAllTypeMaps() it shows that all maps have been defined correctly.

However, the first time I hit a controller action, if I pause before doing anything and run GetAllTypeMaps() again, it shows that I only have one mapping defined, and it's in my Data project. I have tried all the different HeroicAutoMapperConfigurator loading methods to no avail.

UPDATE
So I fixed the issue but I'm a little confused as to why what I did fixed it. Instead of using WebActivator, I commented that line out and manually called the Configure() method in global.asax and everything works now.

UPDATE 2
Ok, I figured out what happened and I feel silly. I installed the nuget package to 3 projects, so the web project was creating the maps correctly, but when the data project was accessed it called it's own Configure() method and overwrote the maps. It now works since I have removed the nuget package from all projects except the web project. Sorry to clutter your issues with a pointless one.

@MattHoneycutt
Copy link
Owner

Hi @jbarrineau06, that's good to know! I'm going to reopen this as a bug: you should definitely be able to install Heroic.AutoMapper to multiple projects without them clobbering each other. I'll come up with a solution for that.

@MattHoneycutt MattHoneycutt reopened this May 11, 2017
@MattHoneycutt MattHoneycutt changed the title Missing type map configuration or unsupported mapping error Missing type map configuration or unsupported mapping error when multiple projects reference Heroic.AutoMapper. May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants