abp icon indicating copy to clipboard operation
abp copied to clipboard

AbpController attribute “ServiceProvider” is NULL

Open lingku7080 opened this issue 7 years ago • 3 comments

System.ArgumentNullException: Value cannot be null.
Parameter name: provider
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Volo.Abp.Application.Services.ApplicationService.LazyGetRequiredService[TService](TService& reference) in D:\github\abp\framework\src\Volo.Abp.Ddd.Application\Volo\Abp\Application\Services\ApplicationService.cs:line 43
   at Volo.Abp.Application.Services.CrudAppServiceBase`7.MapToGetOutputDto(TEntity entity) in D:\github\abp\framework\src\Volo.Abp.Ddd.Application\Volo\Abp\Application\Services\CrudAppServiceBase.cs:line 110
   at System.Linq.Enumerable.SelectListIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Volo.Abp.Application.Services.AsyncCrudAppService`7.GetListAsync(TGetListInput input)
AbpController  attribute “ServiceProvider” is NULL  

lingku7080 avatar Jul 04 '19 19:07 lingku7080

What version of abp are you using? What is the recurring step?

maliming avatar Jul 05 '19 00:07 maliming

I had this issue a couple of days ago and I had forgotten to put DependsOn[typeof(AbpAutofacModule)] in my module. Just a thought.

Without this property injection isn't possible as it's not supported natively in..Net Core

wayneboyles avatar Jul 07 '19 19:07 wayneboyles

Yes, the built-in container does not support property injection. We will all use autofac.

maliming avatar Jul 08 '19 00:07 maliming