0

我正在尝试通过 Autofac Configuration 在我的 .net core3.1 项目中加载依赖项。

但是,我在启动时遇到错误。

找不到类型“TPrefix.TServiceName.Messaging.MessagingModule,TPrefix.TServiceName.Messaging”。它可能需要装配资格,例如“MyType, MyAssembly”。

有人可以帮我指出方向,我哪里出错了。

以下是详细信息——

我的 autofac.json 文件:

    {
  "defaultAssembly": "",
  "components": [], 
  "modules": [
    {
      "type": "TPrefix.TServiceName.Messaging.MessagingModule, TPrefix.TServiceName.Messaging"
    }
  ]
}

我的代码结构如下所示:

在此处输入图像描述

大家好,我正在尝试在TPrefix.TServiceName.Messaging程序集中加载依赖项,如下所示:

namespace TPrefix.TServiceName.Messaging
{
    public class MessagingModule : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
             //Registration code goes here
        }
    }
}
4

1 回答 1

0

我的问题在之后得到了解决。

于 2020-05-21T06:42:28.093 回答