C# 初学者如何在 Linux 中开始使用 Mono?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/796005/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 01:30:31  来源:igfitidea点击:

How to get started with Mono in Linux for a beginner?

c#linuxmono

提问by Josh

How do I start using Mono in Linux as a beginner when I want to switch from Visual Studio?

当我想从 Visual Studio 切换时,初学者如何开始在 Linux 中使用 Mono?

Is there some easy way to install it like Visual Studio and get started? So far,with what I've seen,it looks complex to even get started.

是否有一些简单的方法可以像 Visual Studio 一样安装它并开始使用?到目前为止,就我所见,即使开始也很复杂。

Installing and configuring Mono in linux is a lot of work right?

在 linux 中安装和配置 Mono 需要做很多工作,对吗?

or Is there some distro which I can directly install and get started with applications in Linux?

或者是否有一些发行版可以直接安装并开始使用 Linux 中的应用程序?

采纳答案by Ralph Caraveo

I recently started to dabble in Mono myself and have so far realized that the MonoProject has made huge advancements in this area. It's well worth it to investigate.

我最近自己开始涉足 Mono,到目前为止我意识到 MonoProject 在这方面取得了巨大的进步。非常值得调查。

With that said, the easiest method is to get setup with a Linux distro that is Mono friendly such as Suse, or Ubuntu. Personally, I tried it using Ubuntu 8.10.

话虽如此,最简单的方法是使用对 Mono 友好的 Linux 发行版进行设置,例如 Suse 或 Ubuntu。就个人而言,我使用 Ubuntu 8.10 进行了尝试。

Once you've got your Linux distro setup properly download and install MonoDevelop. This is an open source IDE that's tightly integrated to work with the Mono platform. MonoDevelop was taken as a branch of SharpDevelop and designed to work with the Mono compiler from the ground up.

正确安装 Linux 发行版后,请下载并安装 MonoDevelop。这是一个开源 IDE,与 Mono 平台紧密集成。MonoDevelop 被视为 SharpDevelop 的一个分支,旨在从头开始与 Mono 编译器一起使用。

This is by far the easiest and fastest way to get setup with Mono. The MonoDevelop IDE is very similar to that of Visual C# Express even. It comes complete with Project/Solution management, GUI development using the GTK# framework, an integrated debugger and a host of other features you would expect in an IDE such as code-completion, line numbers, code-folding etc.

这是迄今为止使用 Mono 进行设置的最简单、最快的方法。MonoDevelop IDE 甚至与 Visual C# Express 的 IDE 非常相似。它配备了完整的项目/解决方案管理、使用 GTK# 框架的 GUI 开发、集成调试器以及您在 IDE 中期望的许多其他功能,例如代码完成、行号、代码折叠等。

The folks at the MonoProject are on to something with this suite of tools.

MonoProject 的工作人员正在使用这套工具。

Hope this helps you get started.

希望这可以帮助您入门。

Mono Project Homepage

Mono 项目主页

Mono Develop Homepage

Mono 开发主页

回答by pablo

There are a few interesting books on Mono, although they're probably a little bit old. Still, probably it's worth to grab one and take a look in order to start up.

有一些关于 Mono 的有趣书籍,尽管它们可能有点旧。不过,也许值得抓住一个并看看以启动。

  1. Practical Mono
  2. Mono: A developer's notebook
  3. Cross-Platform .NET development
  4. Mono Kick-start
  1. 实用单声道
  2. Mono:开发人员的笔记本
  3. 跨平台.NET开发
  4. 单声道启动

Then, I'd install latest Mono (2.4) on a Linux box (OpenSuse is the one they use, so it will always go smoothly for development, but we also use Ubuntu internally) and start playing around with the compiler, MonoDevelop (which is quite good since 2.0) and so on.

然后,我会在 Linux 机器上安装最新的 Mono (2.4)(他们使用的是 OpenSuse,所以它的开发总是很顺利,但我们也在内部使用 Ubuntu)并开始使用编译器 MonoDevelop(它自 2.0 以来相当不错)等等。

The only tough point will be writing GUI applications, although my team make extensively use of MWF on different Unix flavors. But everything else will go as you'd expect. I'm specially happy with how great remoting works, for instance.

唯一的难点是编写 GUI 应用程序,尽管我的团队在不同的 Unix 风格上广泛使用 MWF。但其他一切都会如你所愿。例如,我对远程处理的出色工作感到特别满意。

If you're used to Linux then it will be much easier, otherwise I'd also recommend you getting used to it following some tutorial.

如果您习惯了 Linux,那么它会容易得多,否则我还建议您按照一些教程来习惯它。

Remember tools such us NUnit and NAnt will be also available, so you can start writing your code on both Windows and Linux and testing and compiling on both platforms.

请记住,我们还将提供 NUnit 和 NAnt 等工具,因此您可以开始在 Windows 和 Linux 上编写代码,并在两个平台上进行测试和编译。

回答by Xn0vv3r

For a very easy start with mono under linux u can download

要在 linux 下轻松开始使用 mono,您可以下载

  • a vmware image
  • a linux live distro
  • 一个 vmware 映像
  • 一个 linux 实时发行版

with everything included to start.

一切都包括在内。

回答by Xn0vv3r

If you are accustomed to using visual-studio, you can still develop in Visual Studio, and copy your binaries to Linux/OSX or whatever. Or even better, if you have a shared drive, just reconfigure your VS-Project output directory to the shared location.

如果您习惯使用 Visual-studio,您仍然可以在 Visual Studio 中进行开发,并将您的二进制文件复制到 Linux/OSX 或其他任何地方。或者更好的是,如果你有一个共享驱动器,只需将你的 VS-Project 输出目录重新配置到共享位置。

There might be advantages to using the mono compiler, or monodevelop, but since you are getting started, the above is really the easiest thing to do. If you want to run on Linux, the mono installer is an excellent option for getting up and running in a hurry. Unfortunately, there's no installer available for the newest mono release, so you'll either need admin permission, or need to compile from source.

使用 mono 编译器或 monodevelop 可能有优势,但既然你刚开始,以上确实是最简单的事情。如果您想在 Linux 上运行,mono 安装程序是快速启动和运行的绝佳选择。不幸的是,最新的单声道版本没有可用的安装程序,因此您要么需要管理员权限,要么需要从源代码编译。

http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin

http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin

回答by he_the_great

Debian and Ubuntu, and probably all other children, have mono in the repository. So, setting up mono in Linux can be as easy as

Debian 和 Ubuntu,以及可能所有其他的孩子,在存储库中有单声道。因此,在 Linux 中设置 mono 就像

aptitude install monodevelop

However I would suggest version 2 which requires using the 'sid' repository in Debian (don't know about Ubuntu).

但是我建议版本 2 需要在 Debian 中使用“sid”存储库(不了解 Ubuntu)。

vim /etc/apt/sources.list [ :%s/squeeze/sid/g ]

回答by Andrei R?nea

The simplest way I could find is to download the OpenSUSE VMWare Image on their site and just run it. You get all the tools you need :) Preconfigured.

我能找到的最简单的方法是在他们的站点上下载 OpenSUSE VMWare Image 并运行它。您将获得所需的所有工具 :) 预配置。

回答by bouvard

With the just released Ubuntu 9.04a very current Mono development environment is as close as:

在刚刚发布的Ubuntu 9.04 中,当前的 Mono 开发环境非常接近:

apt-get install monodevelop

I used to agree with you that it was somewhat difficult to get going with Mono, but the latest version of Ubuntu has melted that barrier away. And the latest version of Monodevelopis an absolute joy to use.

我曾经同意你的看法,使用 Mono 有点困难,但最新版本的 Ubuntu 已经消除了这个障碍。最新版本的Monodevelop使用起来绝对是一种乐趣。

Don't use Ubuntu? Then I would go with Peter's advice of using a VMWare image.

不使用 Ubuntu?然后我会采纳 Peter 关于使用VMWare 映像的建议。

回答by MariuszS

For installing newest Mono 3.2.5+with MonoDevelop 4.2.1+it is better is use tpokorra repository.

要使用MonoDevelop 4.2.1+安装最新的Mono 3.2.5+,最好使用tpokorra 存储库