mkbundle and MEF



我写了一个应用程序,它运行在我的目标Linux BeagleBone Black和Debian 8派生的操作系统上。

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

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

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

我怀疑这是因为 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 

事实证明,我们的其他开发人员编写的代码是使用 exe 路径创建我们的组合容器。当从 mkbundle 创建的 EXE 内部运行时,此 exe 路径是主 EXE 的 "。

这导致开发人员编写的代码使用空路径。

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

最新更新