运行.NET 4应用程序使用Mono [英] Running .NET 4 application with Mono
问题描述
我试图运行Ubuntu的机器上的.NET EXE(我安装的软件包单完成
),到目前为止,没有运气。编译应用程序使用Visual C#防爆preSS 2010在.NET 4(客户端配置文件)。
I'm trying to run a .NET exe on a Ubuntu machine (I installed the package mono-complete
), so far with no luck. The application is compiled with Visual C# Express 2010 under .NET 4 (Client Profile).
我尝试用下面的命令执行程序:
I try executing the program with the following command:
mono application.exe
不过,我得到了以下错误:
However, I get the following error:
警告:支持运行时版本 此应用程序不可用。 使用默认的运行时:V1.1.4322
WARNING: The runtime version supported by this application is unavailable. Using default runtime: v1.1.4322
**(application.exe:5586):WARNING **:缺少方法 System.Windows.Forms.Application :: SetCompatibleTextRenderingDefault(布尔) 在组装 /usr/lib/mono/gac/System.Windows.Forms/1.0.5000.0__b77a5c561934e089/System.Windows.Forms.dll, 在装配引用 /media/disk/application.exe
** (application.exe:5586): WARNING **: Missing method System.Windows.Forms.Application::SetCompatibleTextRenderingDefault(bool) in assembly /usr/lib/mono/gac/System.Windows.Forms/1.0.5000.0__b77a5c561934e089/System.Windows.Forms.dll, referenced in assembly /media/disk/application.exe
未处理的异常: System.MissingMethodException:方法 未找到: System.Windows.Forms.Application.SetCompatibleTextRenderingDefault。
Unhandled Exception: System.MissingMethodException: Method not found: 'System.Windows.Forms.Application.SetCompatibleTextRenderingDefault'.
它的假设是使用.NET 4中,没有1,但我不知道如何设置它。我试过
It's suppose to be using .NET 4, not 1, but I don't know how to set it. I tried
mono --runtime=4.0.30319.1 application.exe
但是,这并不能工作。
But that didn't work either.
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
听起来你是遇到了这个错误:
Sounds like you're experiencing this bug:
这是假设你安装>单声道2.8(这是第一个支持.NET 4.0)。如果没有,你应该安装较新的单封装。
That is assuming you installed > Mono 2.8 (which was the first release to support .NET 4.0). If not, you should install a more recent Mono package.
其他的事情要记住的是,单不支持的WinForms的全部内容。除非你记住你开发的应用程序使用Mono,有一个很好的机会,你会发现不支持你使用的东西。
The other thing to keep in mind is that Mono doesn't support the entirety of WinForms. Unless you developed your application with Mono in mind, there's a good chance you'll find that something you used isn't supported.
这篇关于运行.NET 4应用程序使用Mono的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!