After much googling, I managed to track this down to a reported issue on github. It seems its related to the new project structure which means items in the Core project are not accessible from Application.Shared.
https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4620
I hope it helps someone and saves them some searching to track down the issue.
Regards, Barry.
Hi All,
I wonder if someone might help to shed some light on an issue which I have noticed. I am putting together a project in AspNetZero Core MVC & Jquery. All is working well except I encountered an issue with the Abp.AutoMapper.
In the documentation there are two AutoMapping methods mentioned:
"CustomDtoMapper.cs is used to create mapping from Person to PersonListDto. FullAuditedEntityDto is inherited to implement audit properties automatically. See application service and DTO documentations for more information. We are adding the following mappings."
And
"We use Abp.AutoMapper library that makes usage of AutoMapper simpler and declarative."
But the example given on the page https://docs.aspnetzero.com/en/aspnet-core-mvc/latest/Infrastructure-Core-Mvc-Dto-Mappings is no longer representative of what is in the codebase, that mapping is now done in CustomDtoMapper.cs.
configuration.CreateMap<Tenant, TenantListDto>();
configuration.CreateMap<TenantEditDto, Tenant>().ReverseMap();
My issue is that Abp.AutoMapper does not seem to work at all from Application.Shared project in any DTO's. For instance if I try to enter the example on the above page in TenantEditDto.cs the Tenant class cannot be resolved.
using System;
using System.ComponentModel.DataAnnotations;
using Abp.Application.Services.Dto;
using Abp.Auditing;
using Abp.AutoMapper;
using Abp.MultiTenancy;
namespace CompassCorejQueryDemo.MultiTenancy.Dto
{
[AutoMap(typeof(Tenant))] //Tenant cannot be resolved here. I have tried the same in many other existing DTO's and in my own ones, but all behave the same, the typeof(class) cannot be resolved.
I have checked and Abp.AutoMapper is still used in other models and in the GraphQL DTO's but not in Application.Shared. All DTO's in Application.Shared are now handled by AutoMapper in CustomDtoMapper.cs.
I cross checked with an Asp.Net Zero MVC5 project and it matches exactly with the exception that Abp.AutoMapper works as intended in the MVC5 project.
Is there a reason for this change or am I missing something obvious? Any advice is appreciated.
Regards, Barry.
Hi,
I have extended ASP.NET Zero .NET Framework template with an entity with a DbGeometry field. It was all compilable and working when running the application. However, I noticed that all unit tests are broken with the following error:
Message: Castle.MicroKernel.ComponentActivator.ComponentActivatorException : ComponentActivator: could not instantiate GISWebTech.Recruit.EntityFramework.RecruitDbContext ---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. -------- System.Collections.Generic.KeyNotFoundException : The given key was not present in the dictionary.
See attachment for a full stack trace from one of the tests. It seems to be failing on instantiating DbContext. Any ideas how to resolve this? I checked the references and they seem to be fine.