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

Using Heroic.Automapper in website (not webapplication) #16

Open
DeathAndTaxes opened this issue Sep 12, 2017 · 1 comment
Open

Using Heroic.Automapper in website (not webapplication) #16

DeathAndTaxes opened this issue Sep 12, 2017 · 1 comment

Comments

@DeathAndTaxes
Copy link

DeathAndTaxes commented Sep 12, 2017

I have a legacy website (which can't be converted to a web application) that I am attempting to use Heroic.Automapper with.

The AutomapperConfig isn't being called by WebActivatorEx (I assume it would not be supported by a website) so I made a direct reference to AutoMapperConfig.Configure() from Application Start in global.asax,cs. It is being called and no exceptions are thrown by HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies();

However no maps are created. Any Automapper action results in a runtime error at the point of the map.

Error:

Missing type map configuration or unsupported mapping.

Mapping types:
SourceClass-> DestinationClass

Class names redacted. The same is unit tested and works in web application so I assume this is a limitation of websites. Any workarounds for getting heroic.automapper working in a asp.net website?

@MattHoneycutt
Copy link
Owner

Try calling this method instead:

HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants