如何使用 Mono 编译 Visual Studio C# 项目 [英] How to compile a Visual Studio C# Project with Mono

查看:69
本文介绍了如何使用 Mono 编译 Visual Studio C# 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,不知道从哪里开始.

I'm new to this, and don't know where to start.

我想在 Linux 上使用 Mono 编译 Visual Studio C# 项目(通过命令行).

I want to compile a Visual Studio C# project with Mono on Linux (by command line).

main.cs 文件包含以下引用:

The main.cs file includes these references:

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using iTextSharp.text;
using iTextSharp.text.pdf;

我不知道我是否需要注意对编译器的引用,或者它是否会自行提取它们,它是否知道在哪里寻找它们.我以前从来没有这样做过.但我只需要编译这个项目.

I have no idea whether I need to note the references to the compiler, or whether it will pull them in itself, whether it will know where to look for them or not. I've never done this before. But I just need to compile this project.

谢谢!

推荐答案

你试过了吗xbuild?它是 Mono 世界中的 MSBuild 等价物.如果 MSBuild 能够在 Windows 中编译您的项目,xbuild 应该能够在 Linux 上执行相同的操作(如果不能,请在 Bugzilla).

Have you tried xbuild? It's the MSBuild equivalent on the Mono world. If MSBuild is able to compile your project in Windows, xbuild should be able to do the same on Linux (if it doesn't, file a bug in Bugzilla).

更新:如今,Mono 开发人员/打包人员正在捆绑原始(最近开源)MSBuild,现在是跨平台的.例如,它已经在 Mac 的最新 Mono 安装程序中可用,因此您可以使用命令行程序 msbuild 来构建您的项目/解决方案(注意:要被 Linux 捆绑还有很长的路要走发行版,因为 msbuild 依赖于 nuget 包,也就是二进制 blob).

UPDATE: Nowadays, Mono developers/packagers are in the process of bundling the original (and recently opensourced) MSBuild, which is now crossplatform. For example it's already available in the latest Mono installers for Mac, so you can use the command-line program msbuild to build your project/solutions (note: still a long way to go to be bundled by Linux distros because msbuild depends on nuget packages, aka binary blobs).

这篇关于如何使用 Mono 编译 Visual Studio C# 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆