Como posso compilar o Hello World mono?

Como posso compilar o Hello World mono?

Eu tenho Ubuntu 11.04 com este mono:

Mono JIT compiler version 2.6.7 (Debian 2.6.7-5ubuntu3)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    GC:            Included Boehm (with typed GC and Parallel Mark)
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none

Estou tentando executar isso:

using System;

public class HelloWorld
{
    static public void Main ()
    {
        Console.WriteLine ("Hello Mono World");
    }
}

e recebo esses erros:

ThinkPad-X201-Tablet:~/Desktop$ gmcs hello.cs
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: The class System.Runtime.CompilerServices.CompilerGeneratedAttribute could not be loaded, used in gmcs
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Missing method .ctor in assembly /usr/lib/mono/2.0/gmcs.exe, type System.Runtime.CompilerServices.CompilerGeneratedAttribute
** (/usr/lib/mono/2.0/gmcs.exe:9128): WARNING **: Can't find custom attr constructor image: /usr/lib/mono/2.0/gmcs.exe mtoken: 0x0a0003d2
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.

Alguma ideia?

Responder1

Compila perfeitamente na minha configuração.

Você deve ter este pacote instalado:

  • desenvolvimento mono-2.0

Isto deve desenhar todas as dependências necessárias para uma compilação de linha de comando. Se você quiser mais conforto, recomendo instalar o pacote monodevelop.

informação relacionada