首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Autofac:使用autofac配置的加载模块问题

Autofac:使用autofac配置的加载模块问题
EN

Stack Overflow用户
提问于 2020-05-20 05:57:18
回答 1查看 145关注 0票数 0

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

但是,我在启动时出错了。

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

有人能帮我指明方向吗?我走错了方向。

详情如下-

我的autofac.json文件:

代码语言:javascript
复制
    {
  "defaultAssembly": "",
  "components": [], 
  "modules": [
    {
      "type": "TPrefix.TServiceName.Messaging.MessagingModule, TPrefix.TServiceName.Messaging"
    }
  ]
}

我的代码结构如下所示:

大家好,我正试图按以下方式加载TPrefix.TServiceName.Messaging程序集中的依赖项:

代码语言:javascript
复制
namespace TPrefix.TServiceName.Messaging
{
    public class MessagingModule : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
             //Registration code goes here
        }
    }
}
EN

回答 1

Stack Overflow用户

发布于 2020-05-21 06:42:28

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61906071

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档