TargetInvocationException - 未将对象引用设置为对象的实例。 for Automapper

时间:2018-06-07 14:35:47

标签: iis asp.net-mvc-5 automapper castle-windsor

我经常在Windows事件查看器中看到以下错误 - 应用程序错误日志。这发生在Amazon Windows Server上。

Web应用程序位于ASP.net MVC 5中。我最近更新了NuGet软件包以解决此错误,但错误仍然存​​在。

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event sequence: 22 
Event occurrence: 9 
Event detail code: 0 

Application information: 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: WebApPath 
    Machine name: EC2AMAZ-TUK4T6L 

Process information: 
    Process ID: 9628 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\ AppPoolName 

Exception information: 
    Exception type: TargetInvocationException 
    Exception message: Exception has been thrown by the target of an invocation.
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type implType, Object[] arguments, ConstructorCandidate constructor)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)

Object reference not set to an instance of an object.
   at AutoMapper.TypeMapFactory.<>c__DisplayClass3_0.<MapDestinationPropertyToSource>b__0(IMemberConfiguration _)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at AutoMapper.TypeMapFactory.CreateTypeMap(Type sourceType, Type destinationType, IProfileConfiguration options, MemberList memberList)
   at AutoMapper.ConfigurationStore.<>c__DisplayClass80_0.<CreateTypeMap>b__0(TypePair tp)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at AutoMapper.ConfigurationStore.CreateMap[TSource,TDestination](String profileName, MemberList memberList)
   at AP.Web.Services.Services.CustInfoService..ctor(ICustInfoRepository repository)

Thread information: 
    Thread ID: 22 
    Thread account name: IIS APPPOOL\ AppPoolName 
    Is impersonating: False 
    Stack trace:    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.FastCreateInstance(Type implType, Object[] arguments, ConstructorCandidate constructor)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)


Custom event details:

无法确定出现此错误的原因。对你的帮助表示感谢。

三江源,

拉​​吉。

0 个答案:

没有答案