c# - 如何使用 Mono 编译 Visual Studio C# 项目

标签 c# visual-studio compiler-construction mono

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

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

main.cs 文件包含这些引用:

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;

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

谢谢!

最佳答案

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

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

关于c# - 如何使用 Mono 编译 Visual Studio C# 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8264323/

相关文章:

c# - 来电者完成连接后,我如何关闭连接?

asp.net-mvc - ASP.NET MVC 和 Visual Studio 2013 : Compilation Error

c++ - 如何找出 C++ header 在 Visual Studio 中编译需要多少时间?

c# - 如何在使用图形类设置插值后保存位图

c# - 如何使用本地 WSDL 文件中的 Web 服务?

.net - Visual Studio : how to debug a library with an external executable?

java - 方法不适用于参数

c# - 不支持异常 : The invoked member is not supported in a dynamic module in C# Unity 5

java - 设置antlr ide和antlr包

c# - 如何检查 azure Active Directory 用户是否已在 approle 中