【问题标题】:Autofac: Issue with loading Module using autofac configurationAutofac:使用 autofac 配置加载模块的问题
【发布时间】:2020-09-06 09:42:50
【问题描述】:

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

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

类型'TPrefix.TServiceName.Messaging.MessagingModule, 找不到 TPrefix.TServiceName.Messaging'。它可能需要 装配资格,例如“我的类型,我的程序集”。

谁能帮我指出方向,我哪里出错了。

以下是详细信息-

我的 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
        }
    }
}

【问题讨论】:

    标签: asp.net-core autofac-module


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多