使用 Mono 进行 C# 开发的可行性

发布于 2024-07-19 06:35:44 字数 486 浏览 8 评论 0原文

最近,我在 Ubuntu linux 中遇到了 Mono 和 MonoDevelop 软件包。 他们声称拥有符合 CLI 的 .NET 运行时。 在自己安装软件包之前,我想了解以下信息:

  1. Mono 有多强大?

  2. 我可以开发GUI应用程序吗 linux喜欢开发WinForm Windows 应用程序。

  3. MonoDevelop IDE 与 Visual Studio IDE 兼容吗? 我可以将 VS 2008 解决方案导入到 MonoDevelop 中并运行吗?

  4. 是否支持.NET 2.0及以上版本?

编辑:再增加一个疑问

是否有任何方法可以在 Linux 中运行 .NET exe(winform 应用程序),而无需在 Linux 中构建代码? 事实上,我没有之前开发的一些小型实用程序的代码,并且想在 Linux 中运行它们。

Recently, I came across Mono and MonoDevelop packages in Ubuntu linux. They claim to have a .NET runtime in accordance with CLI. Before installing the packages myself, I would like to know the following:

  1. How powerful is Mono?

  2. Can I develop GUI application for
    linux like developing WinForm
    applications for Windows.

  3. Is MonoDevelop IDE compatible with Visual Studio IDE. Can I import VS 2008 solutions to MonoDevelop and work?

  4. Does it support .NET 2.0 and above?

EDIT: Adding one more doubt

Is there any way to run the .NET exe (of a winform app) in Linux without building the cod e in linux? In fact I don't have the code for some of the small utilities I developed earlier and would like to run them in linux.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

清引 2024-07-26 06:35:44
  1. (奇怪,markdown 以 1 开始枚举,即使我从 2 开始...)

  2. 是的,你可以,但是你受限于第 3 方组件,因为内部实现不同,而且上次我检查时(不久前),Mono WinForms 实现使我的测试应用程序看起来相当奇怪(所有者绘制的)列表显示)。 虽然 Mono 声称它现在完全兼容 WinForms-2.0,但并不真正推荐。

  3. MonoDevelop 是/曾经是 SharpDevelop 的一个分支,后者拥有解决方案支持。 不知道MonoDevelop有没有。 但最酷的是,您可以使用 Visual Studio 进行开发并在 Mono 上运行编译的应用程序。 顺便说一句,Mono 也可用于 Windows。

    MonoDevelop 是/曾经

  4. 是的,就 CLR 而言确实如此。 正如 Marc Gravell 已经写过的那样,Windows Foundation 库以及其他一些库(例如 System.Management)都丢失了。 但大多数情况下应该可以正常工作,包括 ASP.NET 2.0。 Mono 的应用程序可移植性指南对此很好读。

  1. (Strange, markdown starts the enumeration with one, even though I began with 2...)

  2. Yes, you can, but you're limited with 3rd-party components, because the internal implementation is different, and last time I checked (not very long ago), the Mono WinForms implementation made my test app look rather strange (owner-drawn list view). It is not really recommended, though Mono claims that it's now completely WinForms-2.0-compatible.

  3. MonoDevelop is/was a SharpDevelop branch, with the latter having solution support. I don't know if MonoDevelop has. But the cool thing is, you can just develop with Visual Studio and run your compiled apps on Mono. And Mono is, by the way, also available for Windows.

  4. Yes, it does, as far as the CLR goes. As Marc Gravell already wrote, the Windows Foundation libraries are missing, as are a few other (System.Management, for example). But things should mostly work, including ASP.NET 2.0. Mono's application portability guidelines are a good read on this.

从来不烧饼 2024-07-26 06:35:44

1:实际上相当不错。 并不是所有完整的框架都在那里,所以如果您正在编写应该在 MS .NET 和 mono 上构建的代码,您需要尽早针对这两个平台进行构建和测试

4:是的 - 尽管像 WPF/WCF/WF (3.0) 这样的东西缺失或精简

我对开发环境了解不多,因为我使用VSTS(在Windows上)并且只使用NANT脚本在mono上进行构建...

1: pretty good, actually. Not all the full framework is there, so if you are writing code that should build on both MS .NET and mono, you need to build and test early against both platforms

4: yes - although things like WPF/WCF/WF (3.0) are missing or slimmed down

I don't know much about the development environment, since I use VSTS (on Windows) and just use a NANT script to do the build on mono...

霓裳挽歌倾城醉 2024-07-26 06:35:44
  1. 定义“强大”。
  2. Mono 有一个 WinForms 实现,以允许一定程度的源兼容性。 但是,根据您的需求,您可能希望对 Linux 本机框架使用 Mono 绑定之一,例如 Gtk#Qyoto
  3. 不知道。
  4. 取决于您指的是 .NET 的哪些部分。 C# 语言似乎很流行,越接近企业功能,事情就会变得越模糊,正如已经提到的那样。

总而言之,如果您将 Mono 作为单独的目标平台,则可能会获得良好的结果。 如果您想要一个无需更改代码的 .NET 兼容层,则不必如此。

  1. Define "powerful".
  2. Mono has a WinForms implementation to allow for some level of source compatibility. However, depending on your needs, you might want to use one of the Mono bindings for a Linux native framework, like Gtk# or Qyoto
  3. Wouldn't know.
  4. Depends on what parts of .NET you mean. C# the language seems to be pretty current, things get fuzzier the closer you get to the enterprisey features as was already mentioned.

To sum things up, if you'll be using Mono as a separate target platform, you're likely to have good results. If you want a no-code-changes-required .NET compatibility layer, less so.

你的心境我的脸 2024-07-26 06:35:44
  1. 非常强大。 核心实现中没有重大错误。 这不是一个科学项目。 这些缺陷主要出现在您所期望的地方,即最新的 API(微软在这方面天生具有先发优势)。

  2. 是的。 我们刚刚完成了一个项目,其中大部分 GUI 代码都是在 Windows 上的 WinForms 中开发的。 我可以使用 Ubuntu 来完成它,没有遇到什么大问题。 也就是说,这是 API 最难的部分之一,并且仍然存在问题。 有关详细信息,请参阅 http://mono-project.com/WinForms

  3. 不知道,因为我没用过。
  4. 是的,不过,运行时中可能会缺少一些 API。

请注意,我使用 Ubuntu Hardy (8.04)。

  1. Very powerful. There are no major bugs in the core implementation. It is not a science project. The deficiencies are mostly where you would expect, the newest APIs (Microsoft inherently has a first-mover advantage there).

  2. Yes. We just finished a project where most of the GUI code was developed in WinForms on Windows. I was able to work on it using Ubuntu without major headaches. That said, this is one of the hardest parts of the API, and there are still issues. See http://mono-project.com/WinForms for details.

  3. Don't know, as I don't use it.
  4. Yes, though again, there may be some missing APIs in the runtime.

Note, I use Ubuntu Hardy (8.04).

π浅易 2024-07-26 06:35:44
  1. Mono 非常强大。 它在非常强大的开源框架上拥有所有 .Net 功能。

  2. 当您说“为 Linux 开发 GUI 应用程序就像为 Windows 开发 WinForm 应用程序”时,我理解您是在询问一个可视化设计器,它可以让您快速创建 UI。 对的,这是可能的。 MonoDevelop 有 Stetic - Gtk# 的内置视觉设计器。 还有 QyotoDevelop 可以在 MonoDevelop 中启用 QT 支持。

  3. 是的,MonoDevelop 本身支持 VS 项目/解决方案文件格式。 您可以使用相同的代码库在 Windows 上使用 .Net 中的 VS 来编译应用程序,并在 Linux 上使用 Mono 中的 win MD 来编译应用程序。

  4. 目前,Mono 支持 C# 3.0,其中一些内容超出了已经实现的范围,并且很多内容正在开发中。

    目前,

  5. 是的,在许多情况下,可以在 Mono 中运行 .Net 编译的应用程序,但是有了 MonoDevelop 对 VS 解决方案的支持,这并不重要。 重建整个项目需要按 F7 一样多,所以这个工作量真的可以忽略不计。 检查应用程序是否可以在 Mono 中运行的最佳工具是 MoMA

  1. Mono is mighty powerful. It has all the .Net muscle on a very strong open source skeleton.

  2. When you say "develop GUI application for linux like developing WinForm applications for Windows" I understand that you are asking about a visual designer that will allow you to quickly create the UI. Yes, it is possible. MonoDevelop has Stetic - a built-in visual designer for Gtk#. There is also QyotoDevelop which enables QT support in MonoDevelop.

  3. Yes, MonoDevelop natively supports VS project/solution file format. You can use the same code base to compile your app with VS in .Net on Windows and win MD in Mono on Linux.

  4. Currently Mono supports C# 3.0 with some stuff beyond that already implemented and a lot in the pipeline.

  5. Yes, in many cases it is possible to run a .Net compiled app in Mono, however with MonoDevelop's support for VS solutions it doesn't really matter. It takes as much as pressing F7 to rebuild the whole project, so the effort is really negligible. The best tool for checking if your application can run in Mono is MoMA.

请爱~陌生人 2024-07-26 06:35:44
  1. Mono 非常强大,有时甚至比 Microsoft 的实现还要强大。 链接文本
  2. 是的,可以。
  3. 我相信支持 Winforms 2.0。
  4. 是的,它确实。 支持 C# 3 只需查看 winforms 和 asp.net 实现即可了解支持程度每个项目。 看看 http://mono-project.com
  1. Mono is very powerfull, sometimes even more powerfull than Microsoft's implementation. link text
  2. Yes you can. Winforms 2.0 is supported
  3. I believe so.
  4. Yes it does. C# 3 is supported and just look at winforms and the asp.net implementation to see how much is supported from each of the projects. Look at http://mono-project.com
若能看破又如何 2024-07-26 06:35:44

我在单声道中使用 WinForms。 2.x 版本非常好。

我在 Windows 上的 Visual Studio 中开发表单,并在 Linux 中运行它们,零代码更改。 是的,表单看起来与 XP 上的有点不同,但话又说回来,以 XP 为主题的 GUI 在 GNOME 中看起来有点奇怪。

如果您刚刚开始,请坚持使用 WinForms,同时熟悉 Mono/Linux。 然而,在某些时候您可能想要研究 GTK。

I use WinForms in mono. The 2.x releases are very good.

I develop forms in visual-studio on windows, and run them in Linux, with zero code changes. Yes, forms look a little different than on XP, but then again, an XP-themed GUI would look kind of strange in GNOME.

If you are just getting started, stick with WinForms, while you get comfortable with Mono/Linux. However at some point you might want to investigate GTK.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文