locked
mdtool: System.BadImageFormatException Xamarin.MacDev.dll RRS feed

  • Question

  • User150 posted

    I'm using Xamarin Studio v4.3.1 (build 3). I've to use this version (and not the stable one) because this version seems to fix this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=16250

    Everything is smooth when building my app from Xamarin Studio but I get the following exception if I try to build it from command line using mdtool (mdtool -v build --configuration:"Release" Foobar.sln). I understanding is that Xamarin Studio uses mdtool internally for building so I'm not sure if I'm doing something wrong here.

    ERROR [2014-01-11 14:40:18Z]: Add-in error (MonoDevelop.MonoMac,4.3.1): Error while getting object for node in path '/MonoDevelop/ProjectModel/ProjectServiceExtensions'.
    System.BadImageFormatException: Could not load file or assembly '/Applications/Xamarin Studio.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.MacDev.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    File name: '/Applications/Xamarin Studio.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.MacDev.dll'
      at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
      at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.5/mcs/class/corlib/System.Reflection/Assembly.cs:478
      at Mono.Addins.RuntimeAddin.LoadModule (Mono.Addins.Description.ModuleDescription module, System.Collections.ArrayList asmList) [0x000a1] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:644
      at Mono.Addins.RuntimeAddin.EnsureAssembliesLoaded () [0x00020] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:683
      at Mono.Addins.RuntimeAddin.CheckAddinDependencies (Mono.Addins.Description.ModuleDescription module, Boolean forceLoadAssemblies) [0x00052] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:665
      at Mono.Addins.RuntimeAddin.EnsureAssembliesLoaded () [0x00012] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:682
      at Mono.Addins.RuntimeAddin.CheckAddinDependencies (Mono.Addins.Description.ModuleDescription module, Boolean forceLoadAssemblies) [0x00052] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:665
      at Mono.Addins.RuntimeAddin.EnsureAssembliesLoaded () [0x00012] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:682
      at Mono.Addins.RuntimeAddin.GetType (System.String typeName, Boolean throwIfNotFound) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/RuntimeAddin.cs:319
      at Mono.Addins.TypeExtensionNode.get_Type () [0x0002c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/TypeExtensionNode.cs:104
      at Mono.Addins.TypeExtensionNode.CreateInstance () [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/TypeExtensionNode.cs:93
      at Mono.Addins.InstanceExtensionNode.GetInstance () [0x0000b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/InstanceExtensionNode.cs:73
      at Mono.Addins.InstanceExtensionNode.GetInstance (System.Type expectedType) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/InstanceExtensionNode.cs:55
      at Mono.Addins.ExtensionNode.GetChildObjectsInternal (System.Type arrayElementType, Boolean reuseCachedInstance) [0x0005e] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.3.1-branch/bd211816/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionNode.cs:356
    
    Saturday, January 11, 2014 9:52 PM

All replies

  • User28 posted

    FWIW there is a bug filed for this. It only seems to affect 4.3.1 alpha and 4.2.3 beta.

    Sunday, January 12, 2014 12:23 AM
  • User150 posted

    I don't get this exception on 4.2.3 beta but it has the other libc.dylib bug as discussed here: https://bugzilla.xamarin.com/show_bug.cgi?id=16250 (even with link SDK only selected); so I can't use it.

    As far as I remember v4.3.1 was fine. But the update that I got this morning has this issue.

    Sunday, January 12, 2014 12:33 AM