[SOLVED] Problems with MGCB on Linux - Could not load file [...] assembly:System.Runtime.Serialization

Dear Community,

I am trying to use MonoGame pipeline tool. But when I build a sprite (png file) I get a stack trace. I found out I can call the convert tool directly from the command line, and this is what I get:

 ambs  ~/tmp/mono  1   mgcb Content/fox.png
Build started 1/19/2019 7:07:40 PM

Can't find custom attr constructor image: /usr/lib/mono/xbuild/MonoGame/v3.0/Tools/MonoGame.Framework.dll mtoken: 0x0a000020 due to Could not load file or assembly or one of its dependencies. assembly:System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type: member:

Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
  at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00019] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00040] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.RuntimeType.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x0003e] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ComponentModel.TypeDescriptor.CheckDefaultProvider (System.Type type) [0x0009a] in :0
  at System.ComponentModel.TypeDescriptor.NodeFor (System.Type type, System.Boolean createDelegator) [0x00000] in :0
  at System.ComponentModel.TypeDescriptor.GetProvider (System.Type type) [0x00017] in :0
  at System.ComponentModel.TypeDescriptor.AddAttributes (System.Type type, System.Attribute[] attributes) [0x00028] in :0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.AssignTypeConverter[TType,TTypeConverter] () [0x00021] in <95670a526395468abc6a90f73e1659da>:0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.RegisterCustomConverters () [0x00000] in <95670a526395468abc6a90f73e1659da>:0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager..ctor (System.String projectDir, System.String outputDir, System.String intermediateDir) [0x00069] in <95670a526395468abc6a90f73e1659da>:0
  at MGCB.BuildContent.Build (System.Int32& successCount, System.Int32& errorCount) [0x00059] in <202e545a618548088fcb4f6b2e8e7e46>:0
  at MGCB.Program.Main (System.String[] args) [0x00089] in <202e545a618548088fcb4f6b2e8e7e46>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
  at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00019] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00040] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.RuntimeType.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x0003e] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.ComponentModel.TypeDescriptor.CheckDefaultProvider (System.Type type) [0x0009a] in :0
  at System.ComponentModel.TypeDescriptor.NodeFor (System.Type type, System.Boolean createDelegator) [0x00000] in :0
  at System.ComponentModel.TypeDescriptor.GetProvider (System.Type type) [0x00017] in :0
  at System.ComponentModel.TypeDescriptor.AddAttributes (System.Type type, System.Attribute[] attributes) [0x00028] in :0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.AssignTypeConverter[TType,TTypeConverter] () [0x00021] in <95670a526395468abc6a90f73e1659da>:0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.RegisterCustomConverters () [0x00000] in <95670a526395468abc6a90f73e1659da>:0
  at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager..ctor (System.String projectDir, System.String outputDir, System.String intermediateDir) [0x00069] in <95670a526395468abc6a90f73e1659da>:0
  at MGCB.BuildContent.Build (System.Int32& successCount, System.Int32& errorCount) [0x00059] in <202e545a618548088fcb4f6b2e8e7e46>:0
  at MGCB.Program.Main (System.String[] args) [0x00089] in <202e545a618548088fcb4f6b2e8e7e46>:0
 ambs  ~/tmp/mono  1   file Content/fox.png
Content/fox.png: PNG image data, 54 x 67, 8-bit/color RGBA, non-interlaced

I am using latest Mint with Monogame 3.7.1, installed from the Makeself binary.

Installing libmono-system-runtime-serialization4.0-cil package solved the issue.