c# - Mkbundle Mono Assembly binding redirection -


i have sample .net application runs fine on windows, , ubuntu environment using mono.

i trying use mkbundle create single native assembly can docker containerize using busybox , keep size small instead of huge bloated containers.

the problem running json.net, think due assembly binding redirection app.config file, else ran this?

<?xml version="1.0" encoding="utf-8"?>  <configuration>  <startup><supportedruntime version="v4.0" sku=".netframework,version=v4.5.1" /></startup>      <runtime>        <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">          <dependentassembly>            <assemblyidentity name="newtonsoft.json" publickeytoken="30ad4fe6b2a6aeed" culture="neutral" />            <bindingredirect oldversion="0.0.0.0-6.0.0.0" newversion="6.0.0.0" />          </dependentassembly>        </assemblybinding>      </runtime>    </configuration>

and producing following error both , without --static

enter image description here

how got around specify --nodeps flag.

mkbundle --nodeps -o console outsidesourcesapi.exe *.dll 

however, when run it, may give errors like...

the assembly mscorlib.dll not found or not loaded. 

or

unhandled exception: system.io.filenotfoundexception:  not load file or assembly 'system.xml, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e, retargetable=yes' or 1 of dependencies. 

you'll have specify missing dependencies manually (i know, kinda of stinks)

mkbundle --nodeps -o console outsidesourcesapi.exe *.dll mscorlib.dll system.xml.dll 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -