MxBuild on Linux/MacOSX Error

1
I need to run mxbuild.exe on linux and macosx to build and deploy a Mendix project. When running:  mono mxbuild.exe --help I get the following traceback - any ideas?    __  __      ____        _ _     _    |  \/  |    |  _ \      (_) |   | |   | \  / |_  _| |_) |_   _ _| | __| |   | |\/| \ \/ /  _ <| | | | | |/ _` |   | |  | |>  <| |_) | |_| | | | (_| |   |_|  |_/_/\_\____/ \__,_|_|_|\__,_|    v6.9.1 ERROR: System.TypeInitializationException: The type initializer for 'Mendix.CommandLine.Shared.ApplicationContainerFactory' threw an exception. ---> System.InvalidOperationException: Failed to resolve System.ComponentModel.Composition.resources, Version=4.0.0.0, Culture=en-ZA, PublicKeyToken=b77a5c561934e089.   at Mendix.CommandLine.Shared.AssemblyResolver.CurrentDomainOnAssemblyResolve (System.Object sender, System.ResolveEventArgs args) [0x00049] in <666afb6142de436c893d05b1cf824c7f>:0    at System.AppDomain.DoAssemblyResolve (System.String name, System.Reflection.Assembly requestingAssembly, System.Boolean refonly) [0x0009c] in <8f2c484307284b51944a1a13a14c0266>:0    at (wrapper managed-to-native) System.AppDomain:LoadAssembly (System.AppDomain,string,System.Security.Policy.Evidence,bool)   at System.AppDomain.LoadSatellite (System.Reflection.AssemblyName assemblyRef, System.Boolean throwOnError) [0x00018] in <8f2c484307284b51944a1a13a14c0266>:0    at (wrapper remoting-invoke-with-check) System.AppDomain:LoadSatellite (System.Reflection.AssemblyName,bool)   at System.Reflection.Assembly.InternalGetSatelliteAssembly (System.String name, System.Globalization.CultureInfo culture, System.Version version, System.Boolean throwOnFileNotFound, System.Threading.StackCrawlMark& stackMark) [0x00057] in <8f2c484307284b51944a1a13a14c0266>:0    at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly (System.Globalization.CultureInfo lookForCulture, System.Threading.StackCrawlMark& stackMark) [0x0005e] in <8f2c484307284b51944a1a13a14c0266>:0    at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet (System.Globalization.CultureInfo culture, System.Collections.Generic.Dictionary`2[TKey,TValue] localResourceSets, System.Boolean tryParents, System.Boolean createIfNotExists, System.Threading.StackCrawlMark& stackMark) [0x0003a] in <8f2c484307284b51944a1a13a14c0266>:0    at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo requestedCulture, System.Boolean createIfNotExists, System.Boolean tryParents, System.Threading.StackCrawlMark& stackMark) [0x000ad] in <8f2c484307284b51944a1a13a14c0266>:0    at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, System.Boolean createIfNotExists, System.Boolean tryParents) [0x00002] in <8f2c484307284b51944a1a13a14c0266>:0    at System.Resources.ResourceManager.GetString (System.String name, System.Globalization.CultureInfo culture) [0x0006a] in <8f2c484307284b51944a1a13a14c0266>:0    at Microsoft.Internal.Strings.get_ReflectionModel_PartConstructorThrewException () [0x00005] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.CreateInstance (System.Reflection.ConstructorInfo constructor, System.Object[] arguments) [0x00031] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.GetInstanceActivatingIfNeeded () [0x0009c] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.NotifyImportSatisfied () [0x00016] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.Activate () [0x0000c] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.TryOnComposed () [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part) [0x000ed] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part, System.Boolean shouldTrackImports) [0x00047] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports (System.ComponentModel.Composition.Primitives.ComposablePart part) [0x00033] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart (System.ComponentModel.Composition.Hosting.ImportEngine engine, System.ComponentModel.Composition.Primitives.ComposablePart part, System.ComponentModel.Composition.Primitives.ExportDefinition definition) [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue (System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogPart part, System.ComponentModel.Composition.Primitives.ExportDefinition export, System.Boolean isSharedPart) [0x00034] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogExport.GetExportedValueCore () [0x00018] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Primitives.Export.get_Value () [0x00012] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.Cast (System.Type type, System.ComponentModel.Composition.Primitives.Export export) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastSingleExportToImportType (System.Type type, System.ComponentModel.Composition.Primitives.Export export) [0x00022] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToCollectionImportType (System.ComponentModel.Composition.Primitives.Export[] exports) [0x00034] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToImportType (System.ComponentModel.Composition.Primitives.Export[] exports) [0x00011] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport (System.ComponentModel.Composition.ReflectionModel.ImportingItem item, System.ComponentModel.Composition.Primitives.Export[] exports) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.Collections.Generic.IEnumerable`1[T] exports) [0x0004a] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.TrySetImport (System.ComponentModel.Composition.Primitives.ImportDefinition import, System.Collections.Generic.IEnumerable`1[T] exports) [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.Collections.Generic.IEnumerable`1[T] imports, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition) [0x00074] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part) [0x000c2] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part, System.Boolean shouldTrackImports) [0x00047] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports (System.ComponentModel.Composition.Primitives.ComposablePart part) [0x00033] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart (System.ComponentModel.Composition.Hosting.ImportEngine engine, System.ComponentModel.Composition.Primitives.ComposablePart part, System.ComponentModel.Composition.Primitives.ExportDefinition definition) [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue (System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogPart part, System.ComponentModel.Composition.Primitives.ExportDefinition export, System.Boolean isSharedPart) [0x00034] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogExport.GetExportedValueCore () [0x00018] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Primitives.Export.get_Value () [0x00012] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.Cast (System.Type type, System.ComponentModel.Composition.Primitives.Export export) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastSingleExportToImportType (System.Type type, System.ComponentModel.Composition.Primitives.Export export) [0x00022] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToCollectionImportType (System.ComponentModel.Composition.Primitives.Export[] exports) [0x00034] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ImportingItem.CastExportsToImportType (System.ComponentModel.Composition.Primitives.Export[] exports) [0x00011] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport (System.ComponentModel.Composition.ReflectionModel.ImportingItem item, System.ComponentModel.Composition.Primitives.Export[] exports) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport (System.ComponentModel.Composition.Primitives.ImportDefinition definition, System.Collections.Generic.IEnumerable`1[T] exports) [0x0004a] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.TrySetImport (System.ComponentModel.Composition.Primitives.ImportDefinition import, System.Collections.Generic.IEnumerable`1[T] exports) [0x00006] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.Collections.Generic.IEnumerable`1[T] imports, System.ComponentModel.Composition.Hosting.AtomicComposition atomicComposition) [0x00074] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part) [0x000c2] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports (System.ComponentModel.Composition.Hosting.ImportEngine+PartManager partManager, System.ComponentModel.Composition.Primitives.ComposablePart part, System.Boolean shouldTrackImports) [0x00047] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports (System.ComponentModel.Composition.Primitives.ComposablePart part) [0x00033] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider+<Compose>c__AnonStorey0.<>m__0 () [0x0000b] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CompositionServices.TryInvoke (System.Action action) [0x00000] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose (System.ComponentModel.Composition.Hosting.CompositionBatch batch) [0x0016b] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose (System.ComponentModel.Composition.Hosting.CompositionBatch batch) [0x00011] in <0007e672dd7f4959adc6f8103d9c843f>:0    at System.ComponentModel.Composition.AttributedModelServices.ComposeParts (System.ComponentModel.Composition.Hosting.CompositionContainer container, System.Object[] attributedParts) [0x00049] in <0007e672dd7f4959adc6f8103d9c843f>:0    at Mendix.Modeler.Plugins.PluginManager.Init (Mendix.Modeler.Core.IModelerCore modelerCore) [0x00042] in <a6a48ebcac424a9aa23c8d3f72241d3e>:0    at Mendix.Modeler.ModelerCore..ctor (Mendix.Modeler.Plugins.IAssemblySource assemblySource, Mendix.Modeler.Core.IProjectManager projectManager) [0x00064] in <a6a48ebcac424a9aa23c8d3f72241d3e>:0    at Mendix.CommandLine.Shared.ApplicationContainerFactory.InitializeModelerCore (Mendix.Modeler.Plugins.IAssemblySource assemblySource, Mendix.Modeler.Utility.DIContainer.IContainer container) [0x00007] in <666afb6142de436c893d05b1cf824c7f>:0    at Mendix.CommandLine.Shared.ApplicationContainerFactory..cctor () [0x0000b] in <666afb6142de436c893d05b1cf824c7f>:0     --- End of inner exception stack trace ---   at Mendix.CommandLine.Shared.ProgramHelper.InitializeAndRun[T] (System.Func`2[T,TResult] program) [0x00005] in <666afb6142de436c893d05b1cf824c7f>:0 
asked
1 answers
1

the “clue” is somewhere in NOT installing the Xamarin-mono key as per the Mono download page, using Debian 8 (problematic to have both the old assemblies that isn’t in Mono since 4.0.0 and the current assemblies that is used by the 7.18(??) and laters that works “flawlessly” on Debian 9’s mono-complete installation.

 

The apt.sources file:

root@deb8:~/6.10.17/modeler# cat /etc/apt/sources.list.d/mono.list 
#https://download.mono-project.com/repo/debian/dists/wheezy/snapshots/3.12
deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12 main

The next is needed to get things going (Oh, and as of this writing Debian 8 is in archive, so remove updates and change to archive to get the apt-get update working), the *key* here : --allow-unauthenticated

root@deb8:~/6.10.17/modeler# apt-get --allow-unauthenticated update
Get:1 http://download.mono-project.com wheezy/snapshots/3.12 InRelease [8050 B]
Ign http://download.mono-project.com wheezy/snapshots/3.12 InRelease    
Ign http://archive.debian.org jessie InRelease                   
Hit http://archive.debian.org jessie Release.gpg
Hit http://archive.debian.org jessie Release
Hit http://archive.debian.org jessie/main amd64 Packages
Hit http://archive.debian.org jessie/contrib amd64 Packages    
Hit http://archive.debian.org jessie/contrib Translation-en    
Hit http://archive.debian.org jessie/main Translation-en       
Ign http://download.mono-project.com wheezy/snapshots/3.12/main amd64 Packages/DiffIndex
Hit http://download.mono-project.com wheezy/snapshots/3.12/main amd64 Packages
Ign http://download.mono-project.com wheezy/snapshots/3.12/main Translation-en
Fetched 8050 B in 2s (3802 B/s)
Reading package lists... Done
W: GPG error: http://download.mono-project.com wheezy/snapshots/3.12 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A6A19B38D3D831EF

 

Jip, that key warning is expected, Xamarin’s mono key used for signing those are expired, and I found I couldn’t remove it from apt (yet), so the “clue” is to NOT have it installed in the first place, and then this does the rest:

root@deb8:~/6.10.17/modeler# apt-get -V --allow-unauthenticated install mono-complete

and you should have mono 3.12
Mono 3.2.8 standard with JEssie Debian8 doesn’t work either with mxbuild…

Testing time:
 

root@deb8:~/6.10.17/modeler# mono --version
Mono JIT compiler version 3.12.1 (tarball Fri Mar  6 19:12:47 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        LLVM:          supported, not enabled.
        GC:            sgen
root@deb8:~/6.10.17/modeler# mono ./mxbuild.exe

   __  __      ____        _ _     _ 
  |  \/  |    |  _ \      (_) |   | |
  | \  / |_  _| |_) |_   _ _| | __| |
  | |\/| \ \/ /  _ <| | | | | |/ _` |
  | |  | |>  <| |_) | |_| | | | (_| |
  |_|  |_/_/\_\____/ \__,_|_|_|\__,_|

   v6.10.18

ERROR: Java Home directory is not specified.
Usage: mxbuild [OPTIONS]+ FILENAME
Build Mendix Deployment Packages (.mda files) using the command-line.
The specified FILENAME is assumed to be a Mendix Project (.mpr) file
that is located inside a project directory.
 

 

answered