我正在尝试在Ubuntu计算机上运行.NET exe文件(我安装了软件包mono-complete
),到目前为止没有任何运气。该应用程序使用Visual C#Express 2010在.NET 4(客户端配置文件)下进行编译。
我尝试使用以下命令执行程序:
mono application.exe
但是,出现以下错误:
警告:支持运行时版本该应用程序不可用。使用默认运行时:v1.1.4322
**(application.exe:5586):警告**:缺少方法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
未处理的例外:System.MissingMethodException:方法未找到:'System.Windows.Forms.Application.SetCompatibleTextRenderingDefault'。
假定正在使用.NET 4,而不是1,但我不知道如何设置它。我尝试过
mono --runtime=4.0.30319.1 application.exe
但是那也不起作用。
任何帮助将不胜感激。
听起来像您遇到此错误:
My Doc's Got No Nodes: .net 4 Client Profile on Mono 2.8
假设您已安装> Mono 2.8(这是支持.NET 4.0的第一个版本)。如果没有,则应该安装更新的Mono软件包。
要记住的另一件事是,Mono不支持整个WinForms。除非您在开发应用程序时考虑到Mono,否则很可能会发现不支持您使用的内容。
我怀疑异常是因为尚未实现System.Windows.Forms.Application.SetCompatibleTextRenderingDefault方法。您是否已通过Mono Migration Analyzer (MoMA)运行了该工具,应该有助于了解您的应用程序是否与Mono兼容。从那时起,您可以解决该问题,甚至可以在代码中合并缺少的方法。
当前的单声道完整软件包(即使在Ubuntu Natty上也使用)不支持.NET 4.0 API的单声道2.6.7。您将必须构建最新版本的mono,这是获得使用4.0 API的最佳途径。但是,在Mono 3.0中计划了对.NET 4.0的“ Complete”支持。
安装Monodevelop,然后右键单击在Linux中是C#.NET项目的example.csprj,然后单击Monodevelop。
当我在ubuntu 18.04上运行.net2.0应用程序时,发生以下错误。请任何人指导我解决此问题
警告:此应用程序支持的运行时版本不可用。使用默认运行时:v4.0.30319libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配libpng警告:iCCP:已知错误的sRGB配置文件libpng警告:iCCP:cHRM块与sRGB不匹配System.Data.SqlClient.SqlException(0x80131904):Snix_Connect(提供者:SNI_PN7,错误:40-SNI_ERROR_40)Snix_Connect(提供者:SNI_PN7,错误:40-SNI_ERROR_40)