true_friend
March 13th, 2008, 03:49 AM
I have a little problem...
I am learning C# 2005 on Mono 1.2.6 and MD .18 Beta. It gives me this error when I try to compile this example.
mcs Main.cs
Main.cs(2,7): error CS0234: The type or namespace name `Generic' does not exist in the namespace `System.Collections'. Are you missing an assembly reference?
Main.cs(2,1): error CS0246: The type or namespace name `Collections.Generic' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 2 error(s), 0 warnings
The actual cod is here
using System;
using System.Collections.Generic;
using System.Text;
namespace SymbolicConstants
{
class SymbolicConstants
{
static void Main(string[] args)
{
const int FreezingPoint = 32; // degrees Fahrenheit
const int BoilingPoint = 212;
System.Console.WriteLine("Freezing point of water: {0}",
FreezingPoint);
System.Console.WriteLine("Boiling point of water: {0}",
BoilingPoint);
BoilingPoint = 21;
}
}
}
I tried the Mono Class Library, it shows that System. Collections.Generic is there in .NET 2. Why the compiler is giving error. Is there any other one to use like 'gmcs'?
Regards
I am learning C# 2005 on Mono 1.2.6 and MD .18 Beta. It gives me this error when I try to compile this example.
mcs Main.cs
Main.cs(2,7): error CS0234: The type or namespace name `Generic' does not exist in the namespace `System.Collections'. Are you missing an assembly reference?
Main.cs(2,1): error CS0246: The type or namespace name `Collections.Generic' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 2 error(s), 0 warnings
The actual cod is here
using System;
using System.Collections.Generic;
using System.Text;
namespace SymbolicConstants
{
class SymbolicConstants
{
static void Main(string[] args)
{
const int FreezingPoint = 32; // degrees Fahrenheit
const int BoilingPoint = 212;
System.Console.WriteLine("Freezing point of water: {0}",
FreezingPoint);
System.Console.WriteLine("Boiling point of water: {0}",
BoilingPoint);
BoilingPoint = 21;
}
}
}
I tried the Mono Class Library, it shows that System. Collections.Generic is there in .NET 2. Why the compiler is giving error. Is there any other one to use like 'gmcs'?
Regards