开发者

Using MEF in a windows service?

I'd like to use MEF in a windows service / WCF se开发者_JAVA百科rvice.

The configuration of the AggregateCatalog is no problem, but what do I do with the methods CreateShell() and InitializeShell()? The service can't have a shell, so do I just return null?

And where would I create and run the bootstrapper? In OnStart of the Service class?


MEF doesn't have CreateShell and InitializeShell methods. I think those are methods that Prism uses. Prism is a UI application framework which uses MEF. Since you are writing a service, you wouldn't use Prism, but you could use MEF.

Create a CompositionContainer connected to the catalog you've created, and then you can pull exports from the container.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜