I have written an app that runs on my target Linux BeagleBone Black with Debian 8 derived OS.
It will run if I install the whole mono-runtime. This is too big for the final targets that I will be running it on.
I would like to use mkbundle to create a static package that has everything embedded.
The problem I am having is that I am using MEF and dependancy injection in this app and when I run the final bundle that mkbundle creates I am getting the error shown below.
I suspect that is because that MEF and / or my app is written to load most of the exports by loading DLL assemblies and they are embedded inside the bundle.
Can anyone shed some light on this?
Here is the error:
[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
Turns out that the code one of our other devs had written was creating our composition container using the exe path. This exe path is "" for the main EXE when run from inside of an mkbundle created EXE.
This was causing the code that dev had written to use an empty path.
I was able to solve it by simply keeping track of the true EXE path and passing that in the the method used to create the container.