I've seen a few posts about not being able to run mcs on something as simple as a Hello World example.  I also can't, with the same error message as others:

D:\dev\c#>type Hello.cs
using System;

class Hello {
    public static void Main(String[] args) {
        Console.WriteLine("mono:: is alive and well...");

        for (int i = 0; i < args.Length; i++)
                Console.WriteLine("Argument {0} = {1}", i, args[i]);
    }
}

D:\dev\c#>mcs Hello.cs

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Guid ---> Syst
em.ArgumentOutOfRangeException: Argument is out of range
in <0x001e3> 00 System.DateTime:.ctor (bool,long)
in <0x00015> 00 System.DateTime:.ctor (long)
in <0x001be> 00 System.CurrentTimeZone:GetDaylightChanges (int)
in <0x00046> 00 System.TimeZone:IsDaylightSavingTime (System.DateTime)
in <0x0001e> 00 System.CurrentTimeZone:GetUtcOffset (System.DateTime)
in <0x00078> 00 System.DateTime:.ctor (bool,long)
in <0x0003b> 00 System.DateTime:get_Now ()
in <0x0004e> 00 .GuidState:.ctor (bool)
in <0x00026> 00 System.Guid:.cctor ()
--- End of inner exception stack trace ---

in (unmanaged) 00 System.Guid:NewGuid ()
in <0x00093> 00 System.Reflection.Emit.ModuleBuilder:.ctor (System.Reflection.Emit.AssemblyBuilder,string,string,bool,bool,bool)
in <0x00159> 00 System.Reflection.Emit.AssemblyBuilder:DefineDynamicModule (string,string,bool,bool)
in <0x00021> 00 System.Reflection.Emit.AssemblyBuilder:DefineDynamicModule (string,string,bool)
in <0x000d0> 00 Mono.CSharp.CodeGen:Init (string,string,bool)
in <0x006be> 00 Mono.CSharp.Driver:MainDriver (string[])
in <0x0001b> 00 Mono.CSharp.Driver:Main (string[])

The version of the compiler I am using is 0.26.42336.0 on a Win2k box.

Now on to the strange part: mcs used to work before I installed Micro$oft's .NET 1.0 framework.  Actually, I installed the 1.1 framework, then backed down to the 1.0 version, and now my Mono compiler doesn't want to work anymore.  Do you think the M$ installation could've done something that is now preventing mcs from working?  Like I said before, mcs used to work before I installed any of the M$ crap.

I want to stick to the Mono stuff as much as possible (I have Mono installed @ home on my RH9 box); somebody please throw a bone at me.

Thanks!

// David

Reply via email to