[Mono-list] mono-core still required after using mkbundle --static to make executable

Eugene Kobrinsky cue at integrate.com
Wed Mar 9 22:31:56 UTC 2016


We tried adding --config /etc/mono and got a segmentation fault when we tried to run the exe. However I got in contact with Alex via IRC and he suggested removing everything but the libc entry in the config file. This appears to have worked!

Here is what our final mkbundle command looked like:
mkbundle --static --deps --config /workspace/output/configtest --machine-config /etc/mono/4.5/machine.config Integrate.Identity.Gateway.exe (all dlls with full paths, space separated) -o identity.exe

contents of “configtest” config file (we copied /etc/mono/config and removed everything but libc to make this file):
<configuration>
        <dllmap dll="libc" target="libc.so.6" os="!windows"/>
</configuration>



From: Alexander Köplinger [mailto:alexander.koeplinger at xamarin.com]
Sent: Tuesday, March 08, 2016 5:57 PM
To: Eugene Kobrinsky <cue at integrate.com>
Cc: mono-list at lists.ximian.com
Subject: Re: [Mono-list] mono-core still required after using mkbundle --static to make executable

You’re missing the dllmaps that remap „libc“ in p/invoke declarations to libc.dylib/libc.so.6/msvcrt.dll, so the program doesn’t find the library.
Pass --config /etc/mono/config to use the default dllmap config that ships with Mono (after verifying the entries make sense for your target).

- Alex

Am 09.03.2016 um 01:28 schrieb Eugene Kobrinsky <cue at integrate.com<mailto:cue at integrate.com>>:

We're being slowly driven nuts by this <OutlookEmoji-&#X1f60a.png>

We finally got mkbundle --static to build a single executable of our microservice, but when we move it to another machine, it fails to run unless we install mono-core (this is all on Cent0S 7 installs).

I've included the error below, but it appears to be MassTransit library specific while the issue gets resolved with installing mono-core (yum install mono-core). This leads us to believe there is some other issue at hand and the error is misleading.

Our mkbundle command:
mkbundle --deps --machine-config /etc/mono/4.5/machine.config --static Integrate.Identity.Gateway.exe /workspace/output/Integrate.dll /workspace/output/Integrate.Nancy.dll /workspace/output/Nancy.dll /workspace/output/MongoDB.Driver.dll /workspace/output/MongoDB.Bson.dll /workspace/output/Newtonsoft.Json.dll /workspace/output/Newtonsoft.Json.7.0.1.dll /workspace/output/Integrate.Identity.dll /workspace/output/Nancy.Hosting.Self.dll /workspace/output/Integrate.Identity.Storage.dll /workspace/output/Integrate.Identity.Service.dll /workspace/output/MassTransit.dll /workspace/output/Magnum.dll /workspace/output/Integrate.MassTransit.dll /workspace/output/MassTransit.Transports.RabbitMq.dll /workspace/output/Integrate.Cache.Redis.dll /workspace/output/ServiceStack.Interfaces.dll /workspace/output/ServiceStack.Redis.dll /workspace/output/ServiceStack.Text.dll /workspace/output/ServiceStack.Common.dll /workspace/output/nunit.framework.dll /workspace/output/Simple.Mocking.dll /workspace/output/Integrate.Identity.Tests.dll /workspace/output/log4net.dll -o integrateapp.exe

Error when trying to run executable without mono-core installed:
Unhandled Exception:
MassTransit.Exceptions.ConfigurationException: An exception was thrown during service bus creation ---> MassTransit.Exceptions.MassTransitException: Failed to start bus services ---> RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.TypeInitializationException: The type initializer for 'System.Net.NetworkInformation.NetworkInterface' threw an exception. ---> System.DllNotFoundException: libc
  at (wrapper managed-to-native) System.Platform:uname (intptr)
  at System.Platform.CheckOS () <0x40a34570 + 0x00047> in <filename unknown>:0
  at System.Platform.get_IsMacOS () <0x40a34540 + 0x00017> in <filename unknown>:0
  at System.Net.NetworkInformation.NetworkInterfaceFactory.Create () <0x40a34450 + 0x0005b> in <filename unknown>:0
  at System.Net.NetworkInformation.NetworkInterface..cctor () <0x40a34420 + 0x0000b> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Net.Sockets.Socket.get_OSSupportsIPv6 () <0x40a78cd0 + 0x00017> in <filename unknown>:0
(error text continues but cutting it off here)

Does anyone have any pointers on what we can try next? We've spent a few days on this at this point and are at a dead end.

We use bindingredirect in our app.config if that matters.

Thanks,

Eugene
_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com<mailto:Mono-list at lists.ximian.com>
http://lists.ximian.com/mailman/listinfo/mono-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20160309/b9358ece/attachment-0001.html>


More information about the Mono-list mailing list