【问题标题】:Autofac.Core.DependencyResolutionException: 'An exception was thrown while activatingAutofac.Core.DependencyResolutionException: '激活时抛出异常
【发布时间】:2020-02-27 05:23:13
【问题描述】:

向我的控制台 API 发送发布请求时出现以下异常:

    Autofac.Core.DependencyResolutionException
      HResult=0x80131500
      Message=An exception was thrown while activating TeocoExcel.DataManager.
      Source=Autofac
      StackTrace:
       at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
       at Autofac.Core.Resolving.InstanceLookup.Execute()
       at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
       at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
       at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
       at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
       at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context)
       at TeocoExcel.Program.Main(String[] args) in C:\Users\mcellery.badio\source\repos\ConsoleApplications\TeocoExcel\TeocoExcel\Program.cs:line 10

Inner Exception 1:
    DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Interfaces.ILoadDataService, Interfaces.IProcessBatchService, Interfaces.IXmlManager, Interfaces.IEmailService)' on type 'DataManager'.

Inner Exception 2:
    TypeInitializationException: The type initializer for 'TeocoExcel.DataManager' threw an exception.

Inner Exception 3:
    COMException: Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

【问题讨论】:

    标签: c# autofac


    【解决方案1】:

    Autofac 未注册 Microsoft.Office.Interop.Excel [CSLID: {00020813-0000-0000-C000-000000000046}]。

    【讨论】:

      猜你喜欢
      • 2013-05-24
      • 1970-01-01
      • 2020-02-07
      • 1970-01-01
      • 2012-05-09
      • 1970-01-01
      • 2013-07-24
      • 2021-03-05
      • 1970-01-01
      相关资源
      最近更新 更多