I have a sample .NET application that runs fine on windows, and my Ubuntu environment using mono.
I am trying to use Mkbundle to create a single native assembly so I can docker containerize it using busybox and keep the size small instead of the usually huge bloated containers.
The problem I am running into is with Json.net, I think its due to assembly binding redirection from the app.config file, anyone else ran into this?
<?xml version="1.0" encoding="utf-8"?>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /></startup>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-126.96.36.199" newVersion="188.8.131.52" />
How I got around it was to specify the --nodeps flag.
mkbundle --nodeps -o console OutsideSourcesAPI.exe *.dll
However, when you run it, it may give you errors like...
The assembly mscorlib.dll was not found or could not be loaded.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Xml, Version=184.108.40.206, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies.
You'll then have to specify any missing dependencies manually (I know, kinda of stinks)
mkbundle --nodeps -o console OutsideSourcesAPI.exe *.dll mscorlib.dll System.Xml.dll