简体   繁体   English

无法使用Mono的dmcs编译简单的C#文件

[英]Unable to compile simple C# file with mono's dmcs

I'm trying to use dmcs to compile a simple C# source file. 我正在尝试使用dmcs编译一个简单的C#源文件。 This is the source file: 这是源文件:

using System;

class MainClass
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello World");
    }
}

I try to compile it with dmcs MainFile.cs , but I the the error: 我尝试使用dmcs MainFile.cs进行编译,但出现错误:

Could not load signature of Mono.CSharp.Driver:Create due to: 由于以下原因,无法加载Mono.CSharp.Driver:Create的签名:

Unhandled Exception: System.TypeLoadException: A type load exception has occurred. 未处理的异常:System.TypeLoadException:发生类型加载异常。 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred. [错误]致命异常:System.TypeLoadException:发生类型加载异常。

I can compile it just fine with gmcs , but I want dmcs to get C#4 features. 我可以使用gmcs进行编译,但是我希望dmcs获得C#4功能。

Does anyone know how to solve that problem? 有谁知道如何解决这个问题?

I'm running mono 2.10.5 on Ubuntu 11.10 我在Ubuntu 11.10上运行mono 2.10.5

事实证明gmcs还支持C#4.0,所以这并不重要...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM