title: Not able to map Dto to ViewModel
body: <p>I am using latest version of AutoMapper.</p>
  
  <p>I have  <code>Mapper.CreateMap&lt;ArticleDto, EditViewModel&gt;();</code> in my automapper bootstrapper class which is called in <code>global.asax</code></p>
  
  <p>Here is the complete listing of same:</p>
  
  <pre><code>public static class AutoMapperConfig
      {
          public static void Configure()
          {
              Mapper.Initialize(cfg =&gt; cfg.AddProfile(new AutomapperWebConfigurationProfile()));
              Mapper.Initialize(cfg =&gt; cfg.AddProfile(new AutomapperServiceConfigurationProfile()));
          }
      }
  
      public class AutomapperWebConfigurationProfile : Profile
      {
          protected override void Configure()
          {
  
              Mapper.CreateMap&lt;CreateArticleViewModel, ArticleDto&gt;()
                  .ForMember(dest =&gt; dest.Title, opts =&gt; opts.MapFrom(src =&gt; src.Title.Trim()))
                  .ForMember(dest =&gt; dest.PostBody, opts =&gt; opts.MapFrom(src =&gt; src.PostBody.Trim()))
                  .ForMember(dest =&gt; dest.Slug,
                      opts =&gt;
                          opts.MapFrom(
                              src =&gt; string.IsNullOrWhiteSpace(src.Slug) ? src.Title.ToUrlSlug() : src.Slug.ToUrlSlug()))
                  .ForMember(dest =&gt; dest.Id, opt =&gt; opt.Ignore())
                  .ForMember(dest =&gt; dest.CreatedOn, opt =&gt; opt.Ignore())
                  .ForMember(dest =&gt; dest.Author, opt =&gt; opt.Ignore());
  
  
              Mapper.CreateMap&lt;ArticleDto, EditViewModel&gt;()
                  .ForMember(dest =&gt; dest.Categories, opt =&gt; opt.Ignore());
  
  
  
               Mapper.AssertConfigurationIsValid();
          }
      }
  </code></pre>
  
  <p>I spent nearly two hours figuring whats wrong with below mappings.</p>
  
  <pre><code> public class ArticleDto
      {
          public int Id { get; set; }
          public string Slug { get; set; }
          public string Title { get; set; }
          public string PostBody { get; set; }
          public DateTime CreatedOn { get; set; }
          public bool IsPublished { get; set; }
          public string Author { get; set; }
          public List&lt;string&gt; ArticleCategories { get; set; }
      }
  
  
  
   public class EditViewModel
      {
          public int Id { get; set; }
          public string Title { get; set; }
          public string PostBody { get; set; }
          public DateTime CreatedOn { get; set; }
          public string Slug { get; set; }
          public bool IsPublished { get; set; }
          public IEnumerable&lt;SelectListItem&gt; Categories { get; set; }
          public List&lt;string&gt; ArticleCategories { get; set; }
      }
  </code></pre>
  
  <p>Here the code in my controller.</p>
  
  <pre><code>// Retrive ArticleDto  from service
  var articleDto = _engine.GetBySlug(slug);
  
  // Convert ArticleDto to ViewModel and send it to view
  var viewModel = Mapper.Map&lt;EditViewModel&gt;(articleDto);
  </code></pre>
  
  <p>this conversion of Dto  to ViewModel fails.</p>
  
  <p>Can anyone help me out on this one? Here is the exception detials</p>
  
  <pre><code>Exception Details: AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.
  
  Mapping types:
  ArticleDto -&gt; EditViewModel
  NoobEngine.Dto.ArticleDto -&gt; NoobEngineBlog.ViewModels.Article.EditViewModel
  
  Destination path:
  EditViewModel
  
  Source value:
  NoobEngine.Dto.ArticleDto
  </code></pre>
  
  <p>Here is what  Mapper.AssertConfigurationIsValid(); results into</p>
  
  <pre><code>Unmapped members were found. Review the types and members below.
  Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
  =============================================================================
  ArticleDto -&gt; EditViewModel (Destination member list)
  NoobEngine.Dto.ArticleDto -&gt; NoobEngineBlog.ViewModels.Article.EditViewModel (Destination member list)
  
  Unmapped properties:
  Categories
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: AutoMapper.AutoMapperConfigurationException: 
  Unmapped members were found. Review the types and members below.
  Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
  =============================================================================
  ArticleDto -&gt; EditViewModel (Destination member list)
  NoobEngine.Dto.ArticleDto -&gt; NoobEngineBlog.ViewModels.Article.EditViewModel (Destination member list)
  
  Unmapped properties:
  Categories
  </code></pre>
  
  <p>As mentioned in above error, here is how i updated my mappings</p>
  
  <pre><code>  Mapper.CreateMap&lt;ArticleDto, EditViewModel&gt;()
                  .ForMember(dest =&gt; dest.Categories, opt =&gt; opt.Ignore());
  </code></pre>
  
  <p>Even then i get the same error as given below.</p>
  
  <pre><code>An exception of type 'AutoMapper.AutoMapperMappingException' occurred in AutoMapper.dll but was not handled in user code
  
  Missing type map configuration or unsupported mapping.
  
  Mapping types:
  ArticleDto -&gt; EditViewModel
  NoobEngine.Dto.ArticleDto -&gt; NoobEngineBlog.ViewModels.Article.EditViewModel
  
  Destination path:
  EditViewModel
  
  Source value:
  NoobEngine.Dto.ArticleDto
  </code></pre>