c# - HelloWorld is successfully launched by Windows .NET but not by MONO -


i've installed mono on 64-bit windows 7 using:

in directory (without spaces in path) changed according jim gomes' advice

successfully run first 2 examples

  • console hello world
  • gtk# hello world

from mono basics article.

but 3d example "winforms hello world" compiled without errors , run windows (by double-clicking in windows explorer) running:

mono hello.exe 

from "mono-3.2.3 command prompt" window produces errors listed below (note first 2 examples including window of second example launched command prompt invoking through mono ...)

what problem , how overcome it?

update
according mentioned article "mono basics" compiled 3d example "winforms hello world" gmcs hello.cs -pkg:dotnet.

btw, dotnet package located?
in directory same name? not have single dir such name dotnet under mono-3.2.3 dir

the errors produced running mono hello.exe "mono-3.2.3 command prompt"

unhandled exception: system.typeinitializationexception:  exception thrown type initializer  system.windows.forms.windowsformssynchronizationcontext  ---> system.typeinitializationexception:  exception thrown type initializer  system.windows.forms.themeengine ---> system.typeinitializationexception:  exception thrown type initializer  system.windows.forms.themewin32classic  ---> system.typeinitializationexception:  exception thrown type initializer system.drawing.knowncolors  ---> system.typeinitializationexception:  exception thrown type initializer system.drawing.gdiplus  ---> system.dllnotfoundexception: /tmp/install/lib/libgdiplus.so @   (wrapper managed-to-native) system.drawing.gdiplus:gdiplusstartup   (ulong&,system.drawing.gdiplusstartupinput&,system.drawing.gdiplusstartupoutput&)   @ system.drawing.gdiplus..cctor () [0x00000] in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.drawing.knowncolors..cctor () [0x00000] in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.drawing.color.get_black () [0x00000] in <filename unknown>:0   @ system.windows.forms.themewin32classic..cctor () [0x00000] in <filename unk nown>:0   --- end of inner exception stack trace ---   @ system.windows.forms.themeengine..cctor () [0x00000] in <filename unknown>: 0   --- end of inner exception stack trace ---   @ system.windows.forms.systeminformation.get_menuaccesskeysunderlined () [0x0 0000] in <filename unknown>:0   @ system.windows.forms.control..ctor () [0x00000] in <filename unknown>:0   @ (wrapper remoting-invoke-with-check) system.windows.forms.control:.ctor ()   @ system.windows.forms.windowsformssynchronizationcontext..cctor () [0x00000]  in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.windows.forms.control..ctor () [0x00000] in <filename unknown>:0   @ system.windows.forms.scrollablecontrol..ctor () [0x00000] in <filename unkn    own>:0   @ system.windows.forms.containercontrol..ctor () [0x00000] in <filename unkno    wn>:0   @ system.windows.forms.form..ctor () [0x00000] in <filename unknown>:0   @ helloworld..ctor () [0x00000] in <filename unknown>:0   @ (wrapper remoting-invoke-with-check) helloworld:.ctor ()   @ helloworld.main () [0x00000] in <filename unknown>:0 [error] fatal unhandled exception: system.typeinitializationexception:    exception thrown type initializer     system.windows.forms.windowsformssynchronizationcontext       ---> system.typeinitializationexception:        exception thrown type initializer       system.windows.forms.themeengine        ---> system.typeinitializationexception:   exception thrown type initializer        system.windows.forms.themewin32classic        ---> system.typeinitializationexception:   exception thrown type initializer         system.drawing.knowncolors          ---> system.typeinitializationexception:   exception thrown type initializer          system.drawing.gdiplus          ---> system.dllnotfoundexception: /tmp/install/lib/libgdiplus.so   @ (wrapper managed-to-native) system.drawing.gdiplus:gdiplusstartup                 (ulong&,system.drawing.gdiplusstartupinput&,system.drawing.gdiplusstartupoutput&)   @ system.drawing.gdiplus..cctor () [0x00000] in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.drawing.knowncolors..cctor () [0x00000] in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.drawing.color.get_black () [0x00000] in <filename unknown>:0   @ system.windows.forms.themewin32classic..cctor () [0x00000] in <filename unk nown>:0   --- end of inner exception stack trace ---   @ system.windows.forms.themeengine..cctor () [0x00000] in <filename unknown>: 0   --- end of inner exception stack trace ---   @ system.windows.forms.systeminformation.get_menuaccesskeysunderlined () [0x0 0000] in <filename unknown>:0   @ system.windows.forms.control..ctor () [0x00000] in <filename unknown>:0   @ (wrapper remoting-invoke-with-check) system.windows.forms.control:.ctor ()   @ system.windows.forms.windowsformssynchronizationcontext..cctor () [0x00000]  in <filename unknown>:0   --- end of inner exception stack trace ---   @ system.windows.forms.control..ctor () [0x00000] in <filename unknown>:0   @ system.windows.forms.scrollablecontrol..ctor () [0x00000] in <filename unkn own>:0   @ system.windows.forms.containercontrol..ctor () [0x00000] in <filename unkno wn>:0     @ system.windows.forms.form..ctor () [0x00000] in <filename unknown>:0   @ helloworld..ctor () [0x00000] in <filename unknown>:0   @ (wrapper remoting-invoke-with-check) helloworld:.ctor ()   @ helloworld.main () [0x00000] in <filename unknown>:0 

i have encountered problem.

i think mono's bug.

if installed mono in c:\program files (x86)\mono-3.2.3\etc\mono

find file c:\program files (x86)\mono-3.2.3\etc\mono\config

change line 29-30:

<dllmap dll="gdiplus" target="/tmp/install/lib/libgdiplus.so" /> <dllmap dll="gdiplus.dll" target="/tmp/install/lib/libgdiplus.so" /> 

to:

<dllmap dll="gdiplus" target="/tmp/install/lib/libgdiplus.so" os="!windows" /> <dllmap dll="gdiplus.dll" target="/tmp/install/lib/libgdiplus.so" os="!windows" /> 

and problem solved.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -