Mono mkbundle和MEF

Mono mkbundle和MEF,mono,mef,mkbundle,Mono,Mef,Mkbundle,我已经编写了一个应用程序,它在我的目标Linux BeagleBone Black上运行,并带有Debian 8衍生操作系统 如果我安装整个mono运行时,它将运行。这对于我将运行它的最终目标来说太大了 我想使用mkbundle创建一个嵌入了所有内容的静态包 我遇到的问题是,我在这个应用程序中使用MEF和依赖注入,当我运行mkbundle创建的最后一个bundle时,我得到如下所示的错误 我怀疑这是因为MEF和/或我的应用程序是通过加载DLL程序集来加载大多数导出的,并且它们被嵌入到包中 有人能

我已经编写了一个应用程序,它在我的目标Linux BeagleBone Black上运行,并带有Debian 8衍生操作系统

如果我安装整个mono运行时,它将运行。这对于我将运行它的最终目标来说太大了

我想使用mkbundle创建一个嵌入了所有内容的静态包

我遇到的问题是,我在这个应用程序中使用MEF和依赖注入,当我运行mkbundle创建的最后一个bundle时,我得到如下所示的错误

我怀疑这是因为MEF和/或我的应用程序是通过加载DLL程序集来加载大多数导出的,并且它们被嵌入到包中

有人能解释一下吗

以下是错误:

[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: 'path' cannot be an empty string ("").
Parameter name: path
  at Microsoft.Internal.Requires.NotNullOrEmpty (System.String value, System.String parameterName) [0x00022] in <0007e672dd7f4959adc6f8103d9c843f>:0 
at System.ComponentModel.Composition.Hosting.DirectoryCatalog..ctor (System.String path, System.String searchPattern) [0x00011] in <0007e672dd7f4959adc6f8103d9c843f>:0 
at NonWindowsCommon.MefDI.<DirectoryCatalogContainer>m__1 (System.String path) [0x00022] in <15e2f18d34444e41a666c99ead602eed>:0 
at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00064] in <63992662b765477a898ef49cdcc99ee2>:0 
at System.Diagnostics.Contracts.Contract.ForAll[T] (System.Collections.Generic.IEnumerable`1[T] collection, System.Predicate`1[T]   predicate) [0x00048] in <8f2c484307284b51944a1a13a14c0266>:0 
at Microsoft.Internal.Requires.NotNullElements[T] (System.Collections.Generic.IEnumerable`1[T] values, System.String parameterName) [0x00013] in <0007e672dd7f4959adc6f8103d9c843f>:0 
at Microsoft.Internal.Requires.NullOrNotNullElements[T] (System.Collections.Generic.IEnumerable`1[T] values, System.String parameterName) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0 
at System.ComponentModel.Composition.Hosting.AggregateCatalog..ctor (System.Collections.Generic.IEnumerable`1[T] catalogs) [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0 
at NonWindowsCommon.MefDI.DirectoryCatalogContainer (System.String basepath) [0x0002c] in <15e2f18d34444e41a666c99ead602eed>:0 
at Ignition.CommandLine.Program.Configure () [0x0006b] in <c9925f8b4dd141c2a6ea39dd7842d0d4>:0 
at Ignition.CommandLine.Program..ctor () [0x00012] in <c9925f8b4dd141c2a6ea39dd7842d0d4>:0 
at Ignition.CommandLine.Program.Main (System.String[] args) [0x00001] in <c9925f8b4dd141c2a6ea39dd7842d0d4>:0 
[ERROR]致命的未处理异常:System.ArgumentException:“path”不能是空字符串(“”)。
参数名称:路径
0中的Microsoft.Internal.Requires.NotNullOrEmpty(System.String值,System.String参数名)[0x00022]处
位于:0中的System.ComponentModel.Composition.Hosting.DirectoryCatalog..ctor(System.String路径,System.String搜索模式)[0x00011]
在0中的NonWindowsCommon.MefDI.m__1(System.String路径)[0x00022]处
位于System.Linq.Enumerable+WhereSelectEnumerableInterator`2[TSource,TResult].MoveNext()[0x00064]中:0
0中的System.Diagnostics.Contracts.Contract.ForAll[T](System.Collections.Generic.IEnumerable`1[T]集合,System.Predicate`1[T]谓词)[0x00048]
在Microsoft.Internal.Requires.NotNullElements[T](System.Collections.Generic.IEnumerable`1[T]值,System.String参数名)[0x00013]中:0
在Microsoft.Internal.Requires.NullOrNotNullElements[T](System.Collections.Generic.IEnumerable`1[T]值,System.String参数名)[0x00000]中:0
位于:0中的System.ComponentModel.Composition.Hosting.AggregateCatalog..ctor(System.Collections.Generic.IEnumerable`1[T]目录)[0x00006]
在0中的NonWindowsCommon.MefDI.DirectoryCatalogContainer(System.String basepath)[0x0002c]处
在0中的点火开关.CommandLine.Program.Configure()[0x0006b]处
在点火开关处.CommandLine.Program..ctor()[0x00012]输入:0
在:0中的Ignition.CommandLine.Program.Main(System.String[]args)[0x00001]处

我们的另一个开发人员编写的代码是使用exe路径创建合成容器。从mkbundle创建的exe内部运行时,主exe的此exe路径为“”

这导致dev编写的代码使用空路径

我能够通过简单地跟踪真正的EXE路径并将其传递到用于创建容器的方法中来解决这个问题