我在Visual Studio 2010上使用C#.Net中的WinForm开发了一个测试应用程序.现在,我想在Linux下使用Mono在CentOS上运行它.所以我尝试了下面的命令序列 –
[root@localhost TestLinux]# /usr/bin/mono ./Test.exe
我遇到了一个例外
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>
在做一些研究的时候,我发现这是由于gdiplus.dll与其对应部分libgdiplus.so.0在linux上的链接,需要将其条目放在ldconfig缓存中.
[root@localhost TestLinux]# ldconfig -p | grep libgdiplus
libgdiplus.so.0 (libc6) => /usr/lib/libgdiplus.so.0
输出清楚地显示libgdiplus.so.0在ldconfig缓存中,但程序仍然无法正常工作.我还尝试在应用程序配置中添加DllMap条目,如下所示
如果有人在过去偶然发现这件事,请告诉我.
最佳答案
您已错误地追踪错误.
您的单声道版本不支持EnableVisualStyles.
升级到支持它的版本(据我记得它是> = 2.9)或尝试在.net应用程序中禁用此功能,这将导致“不太好的ui元素”.
对我来说,它工作,因为我正在研究gentoo.
突然,在出现之后,我的单声道应用程序不再崩溃了.
您的单声道版本不支持EnableVisualStyles.
升级到支持它的版本(据我记得它是> = 2.9)或尝试在.net应用程序中禁用此功能,这将导致“不太好的ui元素”.
对我来说,它工作,因为我正在研究gentoo.
突然,在出现之后,我的单声道应用程序不再崩溃了.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。