Don't forget to register your MEF container itself in your Boostrapper:
来源:互联网 发布:软件研发设备清单 编辑:程序博客网 时间:2024/06/16 09:38
Ideally, you should NOT use DI container anymore. Your code should NOT know about existance of DI container (from this side Unity is really DI container, because you can write code which will not know about using DI container). If your code knows about it - it DEPENDS on DI container, and it's bad thing.
PS. If you want to use MEF container in your module anyway (for example, because you're not very familiar with DI paradigm or you have some very specific tasks), you can try something like:
[ModuleExport(typeof(YourModule))]public class YourModule : IModule{ public static CompositionContainer CompositionContainer; [ImportingConstructor] public void YourModule(CompositionContainer container) { this.CompositionContainer = container; }}
Don't forget to register your MEF container itself in your Boostrapper:
public class YourBootstrapper: MefBootstrapper{ protected override CompositionContainer CreateContainer() { var container = base.CreateContainer(); container.ComposeExportedValue(container); return container; }}
0 0
- Don't forget to register your MEF container itself in your Boostrapper:
- Don't forget your dream
- Don't forget your original intention.
- Don't submit your website to any search engines
- Providing Metadata to your MEF exports
- don't forget.
- You Don’t Miss Your Water
- Don't work for your salary!
- Don't hard code your DataProviders
- don't forget to append one ';' after every class definition
- Don't hesitate to upgrade your ubuntu to Lucid even with Intel GMA 500
- Your DbgPrint or KdPrint messages don't appear in WinDbg (or KD) when you run your driver on Windows
- register controls in your web.config file
- What is success if you don't know your main goal in life?
- 在Ubuntu 上编译qt4.8.6,提示“You don't seem to have 'make' or 'gmake' in your PATH. cannot proceed".”
- Security error. You probably don't have enough permissions to upload. Please check your server
- 122. Don't teach your grandmother to suck eggs. 不要班门弄斧
- In POSIX systems, you don't find -r parameter for grep and your grep -rn "stuff" . won't run
- ZOJ 3483 Gaussian Prime
- linux下quartus出现ModelSim executable not found和Unable to checkout a license. Make sure...... 错误
- oracle 数据库开发面试题
- 如何查看和停止Linux启动的服务
- Multi-scale orderless pooling of deep convolutional activation features
- Don't forget to register your MEF container itself in your Boostrapper:
- Objective-C学习备忘单
- Java树形菜单 递归实现
- 翌生美的夏日美丽经
- auto_ptr的使用及其源代码
- poj2406
- UML中类之间的几种关系
- 转载_win2003下安装破解汉化jira5步骤_史上最细节
- X技术概要(二)