Autofac属性注入无法正常工作 [英] Autofac property injection is not working
本文介绍了Autofac属性注入无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将autofac用于棱镜.使用过的bootstraper项目链接如下.当我用作构造参数时,autofac是传递独立对象.但是当我用作具有导入属性的属性时,它不会通过.
i am trying to use autofac for prism. Used bootstraper project link is bellow. autofac is passes depened object when i used as contructor parameter. but it's not passes when i use as property with a import attribute.
https://bitbucket.org/stmu/prism.aufofacextension/src
这不是一个棱柱问题. autofac不是注入属性.我的错是什么?怎么解决呢?谢谢.
it's not a prism question. autofac is not inject properties. what is my mistake? how to solve this? thanks.
推荐答案
在您的RegisterType
通话中,您很可能需要添加.PropertiesAutowired()
.
On your RegisterType
calls, you most likely need to add .PropertiesAutowired()
.
这篇关于Autofac属性注入无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文