Mono - eiichiromomma/CVMLAB GitHub Wiki

Mono

Microsoft.Netと互換性のあるC#とCLRのクロスプラットフォームなバイナリ実行環境

※殆どCLRの話

DLLが見付からない場合に出るエラーと対処

msvcmxx.dll

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for <Module> --->System.DllNotFoundException: msvcm90.dll
  at (wrapper managed-to-native) <Module>:<CrtImplementationDetails>.ThrowModuleLoadException (string,System.Exception)
  at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport* ) [0x00000] 
  at <Module>..cctor () [0x00000] --- End of inner exception stack trace ---

Visual Studioでアプリケーションをビルドする際に「共通言語ランタイムサポート」を「/clr:safe」にする。

CPlusPlus - Mono に書いてあった。

gdiplus.dll

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type 
initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: 
An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
    (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace ---

  at <0x00000> <unknown method>
  at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000] 
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] 
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] 
  at System.Windows.Forms.XplatUI..cctor () [0x00000] --- End of inner exception stack trace ---

  at <0x00000> <unknown method>
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] 

~/.mono/configを

<configuration>
       <dllmap dll="gdiplus.dll" target="libgdiplus.so.0" os="!windows"/>
</configuration>

とする。(so.の後の数字は/usr/lib, /usr/lib64あるいは/usr/local/libを確認する)

⚠️ **GitHub.com Fallback** ⚠️