Bug 51650 - mkbundle [ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Exception of type 'System.Exception' was thrown.
Summary: mkbundle [ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Exception of ty...
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: mkbundle ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-19 22:11 UTC by pr0vieh
Modified: 2017-12-24 04:57 UTC (History)
12 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description pr0vieh 2017-01-19 22:11:17 UTC
hi,
mkbundle is broken once again

mkbundle -v 
-o mytool.exe \
--custom --deps --static --i18n all \
/mytool/mytool.exe \
/mytool/*.dll \
--config /usr/local/etc/mono/config \
--machine-config /usr/local/etc/mono/4.5/machine.config

Output:
OS is: Linux
Sources: 9 Auto-dependencies: True
Log:

Log:

Log:

Log:

Log:

Log:

ERROR: Couldn't load one or more of the i18n assemblies.

Unhandled Exception:
System.Exception: Exception of type 'System.Exception' was thrown.
  at MakeBundle.Error (System.String msg, System.Object[] args) [0x00016] in <6817c29d2b7040baa4f41f49a2fa0851>:0
  at MakeBundle.LoadLocalizedAssemblies (System.Collections.Generic.List`1[T] assemblies) [0x000b2] in <6817c29d2b7040baa4f41f49a2fa0851>:0
  at MakeBundle.Main (System.String[] args) [0x00d14] in <6817c29d2b7040baa4f41f49a2fa0851>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Exception of type 'System.Exception' was thrown.
  at MakeBundle.Error (System.String msg, System.Object[] args) [0x00016] in <6817c29d2b7040baa4f41f49a2fa0851>:0
  at MakeBundle.LoadLocalizedAssemblies (System.Collections.Generic.List`1[T] assemblies) [0x000b2] in <6817c29d2b7040baa4f41f49a2fa0851>:0
  at MakeBundle.Main (System.String[] args) [0x00d14] in <6817c29d2b7040baa4f41f49a2fa0851>:0

why this happens ? ERROR: Couldn't load one or more of the i18n assemblies. 

i have also checked without:
--i18n all
and with:
/usr/local/lib/mono/4.5/I18N*.dll
the same problem... :/

Have I overlooked something ?

greets Pr0vieH
Comment 1 Austin Sojka 2017-01-20 22:13:28 UTC
I can confirm this bug as well. And that is on a fresh ubuntu install with the latest CI build. 

As a side note, if you use --cross to target your own platform (for me 4.8.0-linux-libc2.12-amd64.zip) the error doesn't occur. However, the --static option is not working, it literally does nothing different that if it wasn't used. That could be a completely separate issue though.
Comment 2 Katelyn Gadd 2017-05-24 12:24:30 UTC
I can also confirm that mkbundle doesn't seem to work at all.

kate@reeir-ubuntu:~/Projects/bundle/TestApp/bin/Debug$ mkbundle -v TestApp.exe
OS is: Linux
Sources: 1 Auto-dependencies: False
Log: 

Log: 

ERROR: Couldn't load one or more of the i18n assemblies: Failed to load I18N.dll
Comment 3 Miguel de Icaza [MSFT] 2017-05-24 13:26:03 UTC
When using the custom mode and the new --i18n [LANGUAGE], you must specify the library directory to locate your assemblies, you are missing the -L argument, something like this:

-L /usr/local/lib/mono/4.5

I am adding some better error reporting to better guide you.
Comment 4 Natan 2017-05-24 15:06:19 UTC
May be completely irrelevant but I had the same issue after upgrading to mono 5.0 and fixed it by adding -L /usr/local/lib/mono/4.5. But now the bundle fails to run on environments without mono or with old mono installed.

Old mono:
Corlib not in sync with this runtime: expected corlib version 1050000000, found 138.
Loaded from: /usr/lib/mono/4.5/mscorlib.dll
Download a newer corlib or a newer runtime at http://www.mono-project.com/download.

No mono:
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/lib/mono/4.5/mscorlib.dll' directory.
Comment 5 pr0vieh 2017-05-24 23:56:42 UTC
mkbundle -o /TestAppB.exe -L /usr/local/lib/mono/4.5 --custom --deps --static --i18n all /TestApp.exe --config /usr/local/etc/mono/config --machine-config /usr/local/etc/mono/4.5/machine.config

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <377f316bff2149d8bb6117216530a8d1>:0
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <377f316bff2149d8bb6117216530a8d1>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <377f316bff2149d8bb6117216530a8d1>:0
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <377f316bff2149d8bb6117216530a8d1>:0


the static option is not working @all i hope we can locate the problem

greets Pr0vieH
Comment 6 Katelyn Gadd 2017-05-25 07:09:20 UTC
I can also reproduce the QueueAssembly issue when I use --deps.
Comment 7 pr0vieh 2017-05-25 13:52:49 UTC
yes --static with --deps option is brocken right!
Comment 8 Dave 2017-07-14 14:02:28 UTC
This is broken for me as well. Is there a plan to fix this...?
Comment 9 Assem Radaideh 2017-08-07 12:02:23 UTC
Starting from 5.2, mkbundle crashes for my exe and dependent assemblies on macOS.

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 


I use it with --deps option.
Comment 10 Arthur Khusnutdinov 2017-08-20 21:44:52 UTC
Same bug, please, fix!
Comment 11 Marek Safar 2017-09-07 10:22:23 UTC
I cannot reproduce the issue with the latest mono. Please include full repro if you can still reproduce it.
Comment 12 xamarin 2017-12-24 04:57:12 UTC
I'm seeing this in Ubuntu 16.04.2 (64-bit). Just ran this:

steveno@ubuntu:~/projects/gitRepos/VINTage/Locutus/LtoFlash/bin/Debug/Linux$ mkbundle -o LtoFlash LtoFlash.exe --deps -L /usr/lib/mono/4.5

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <2ccea4180e644ec3b99a1f4fcb41bf02>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <2ccea4180e644ec3b99a1f4fcb41bf02>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <2ccea4180e644ec3b99a1f4fcb41bf02>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <2ccea4180e644ec3b99a1f4fcb41bf02>:0 

App created w/ MonoDevelop, targeting 4.5.

Just installed latest mono-complete.