[Pkg-mono-devel] Mono Beta 1 Preview Packages

Tomasz Rybak bogomips@post.pl
Mon, 10 May 2004 19:23:04 +0200


I cannot compile simple program:
using System;
using System.Data;
using System.Data.Common;
using System.Xml;
using Npgsql;
using NpgsqlTypes;

public class Test 
{
	public static void PrintError(NpgsqlException e)
	{
		Console.WriteLine(e.Message);
		Console.WriteLine(e.Source);
		Console.WriteLine(e.StackTrace);

	}
	public Test()
	{
	}
	public static void Main(string [] args)
	{
		try {	
			dbcon = new NpgsqlConnection("Server=localhost;Database=filesystem;"
+
			"User ID=tomus;Password=;");
			dbcon.Connect();
			dbconn.Disconnect();

		} catch (NpgsqlException e0) {
			PrintError(e0);
		}
	}
	private IDbConnection dbcon;
}

$ mcs db.cs
db.cs(32) error CS0246: Cannot find type `IDbConnection'
db.cs(10) error CS0246: Cannot find type `NpgsqlException'
db.cs(2) error CS0246: The namespace `System.Data' can not be found
(missing assembly reference?)
    Try using -r:System.Data
db.cs(3) error CS0246: The namespace `System.Data.Common' can not be
found (missing assembly reference?)
db.cs(5) error CS0246: The namespace `Npgsql' can not be found (missing
assembly reference?)
db.cs(6) error CS0246: The namespace `NpgsqlTypes' can not be found
(missing assembly reference?)
Compila mcs db.cs -r System.Data -r Npgsql
error CS0006: Cannot find assembly `System.Data'
Log:
 
error CS0006: Cannot find assembly `Npgsql'
Log:
 
Compilation failed: 2 error(s), 0 warningstion failed: 6 error(s), 0
warnings
$ 

I tried adding -lib, setting MONO_PATH, but it didn't work.
When I give full path (/usr/lib/mono/gac/...) to each dll, it works.

But I can import assemblies to GAC - both user and system GAC.
Again -  must give full path to my dll to mcs.

-- 
Tomasz Rybak <bogomips@post.pl>