Mapper not initialized
See original GitHub issueAn exception of type ‘System.InvalidOperationException’ occurred in AutoMapper.dll but was not handled in user code
Additional information: Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you’re using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
[AutoMapFrom(typeof(Provider))]
public class ProviderListDto : EntityDto<long>
{
public string Name { get; set; }
public string Email { get; set; }
public Guid Guid { get; set; }
}
public class Provider : Entity<long>
{
public Provider()
{
}
[Required]
[MaxLength(128)]
public string Name { get; set; }
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
public Guid Guid { get; set; }
}
What is wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Automapper error saying mapper not initialized
"Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or ...
Read more >'Mapper not initialized. Call Initialize with appropriate ...
If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the...
Read more >unit test failing for mapper not initialized #5065
Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or ...
Read more >C# – Mapper not initialized. Call Initialize with appropriate ...
Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, ...
Read more >Mapper not initialized #7471
Hi, after the update of my solution to v7.1.0 for ASP.NET MVC 5.x & Angularjs 1.x .NET Framework 4.6.1 I've this expection in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Immanuel-Licht
Is it related to this? #2052
No problem. 😄