【发布时间】:2012-06-28 00:36:12
【问题描述】:
我有一个使用 MEF 的控制台应用程序。它在本地和部署到开发机器时都可以正常工作。当部署到发布机器时,它会引发组合错误。
开发和发布机器都是虚拟 sql server 2008 r2 机器,具有相同的规格和安装的大部分软件和组件。有一个构建和部署过程,但即使将文件从 dev 复制到 release 并运行它们也会导致相同的错误。
我是否需要 MEF 的任何先决条件,而这些先决条件或权限可能在发布机器上缺失?
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Resulting in: An exception occurred while trying to create an instance of type 'XXX.XXX.Dispatch.EmailDispatcher'.
Resulting in: Cannot activate part 'XXX.XXX.Dispatch.EmailDispatcher'.
Element: Lifetime.CrmBroker.Dispatch.EmailDispatcher --> XXX.XXX.Dispatch.EmailDispatcher --> AssemblyCatalog (Assembly="XXX.XXX, Version=1.1.2264.871, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot get export 'XXX.XXX.Dispatch.EmailDispatcher (ContractName="XXX.XXX.Dispatch.IEntityTypeDispatcher")' from part 'XXX.XXX.Dispatch.EmailDispatcher'.
Element: XXXX.XXX.Dispatch.EmailDispatcher (ContractName="XXXX.XXX.Dispatch.IEntityTypeDispatcher") --> XXX.XXX.Dispatch.EmailDispatcher --> AssemblyCatalog (Assembly="XXX.XXX, Version=1.1.2264.871, Culture=neutral, PublicKeyToken=null")
Resulting in: Cannot set import 'XXX.XXXX.Dispatch.DispatcherRepository.Dispatchers (ContractName="XXX.XXX.Dispatch.IEntityTypeDispatcher")' on part 'XXX.XXX.Dispatch.DispatcherRepository'.
Element: XXX.XXX.Dispatch.DispatcherRepository.Dispatchers (ContractName="XXX.XXX.Dispatch.IEntityTypeDispatcher") --> XXX.XXX.Dispatch.DispatcherRepository
(System.ComponentModel.Composition.CompositionException)
【问题讨论】:
标签: .net components mef composition