title: C# program doesn't work under mono in Linux.
body: <p>I am trying to make my program written in Visual C# 2010 work on Linux. For that, I have used mkbundle feature, so that potential client doesn't have to install mono. Unfortunately I am not knowledgeable about Linux or Mono, so I have just followed this: <a href="https://stackoverflow.com/questions/1906843/c-sharp-cywgwin-mono-mkbundle-windows-7-cannot-compile-file">c# cywgwin mono mkbundle windows 7 - cannot compile file</a></p>
  
  <p>But for some reason mkbundle writes [FAIL] in the end, saying something about "No such file or directory". I have pasted the full text below. Does anybody know how to solve this?</p>
  
  <pre><code>$ mkbundle -o MyProgram MyProgram.exe --deps
  OS is: Windows
  Sources: 1 Auto-dependencies: True
     embedding: C:\cygwin\home\Synaps\MyProgram.exe
     embedding: C:\Mono-2.10.8\lib\mono\4.0\mscorlib.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Drawing.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\Mono.Security.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Configuration.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Xml.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Security.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Windows.Forms.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\Accessibility.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\Mono.WebBrowser.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\Mono.Posix.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Data.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\Mono.Data.Tds.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.Transactions.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\System.EnterpriseServices.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\AForge.Imaging.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\AForge.dll
     embedding: C:\Mono-2.10.8\lib\mono\4.0\AForge.Math.dll
  Compiling:
  as -o temp.o temp.s
  gcc -mno-cygwin -g -o MyProgram -Wall temp.c `pkg-config --cflags --libs mono-2|d
  os2unix`  temp.o
  : No such file or directory
  temp.c: In function `main':
  temp.c:143: warning: implicit declaration of function `g_utf16_to_utf8'
  temp.c:143: warning: assignment makes pointer from integer without a cast
  temp.c:158: warning: assignment makes pointer from integer without a cast
  [Fail]
  </code></pre>
  
  <p>When I tried to use mkbundle on Linux virtual machine, I successfully obtained Linux executable, but get the following error, whenever I run the program under Ubuntu Linux VM (by Oracle VM Virtual Box):</p>
  
  <pre><code>Unhandled Exception: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
    at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Drawing.Bitmap.SetResolution (Single xDpi, Single yDpi) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:SetResolution (single,single)
    at AForge.Imaging.ColorReduction.ColorImageQuantizer.ReduceColors (System.Drawing.Bitmap image, Int32 paletteSize) [0x00000] in &lt;filename unknown&gt;:0 
    at FootMeasure.Program.Main (System.String[] args) [0x00000] in &lt;filename unknown&gt;:0 
  [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
    at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Drawing.Bitmap.SetResolution (Single xDpi, Single yDpi) [0x00000] in &lt;filename unknown&gt;:0 
    at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:SetResolution (single,single)
    at AForge.Imaging.ColorReduction.ColorImageQuantizer.ReduceColors (System.Drawing.Bitmap image, Int32 paletteSize) [0x00000] in &lt;filename unknown&gt;:0 
    at FootMeasure.Program.Main (System.String[] args) [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>