[Mono-list] newbie: run-time errors with core dumped in console app

R.A.M. r_ahimsa_m at poczta.onet.pl
Tue Sep 18 13:01:14 EDT 2007


Hi,
I have written simple console program reading data from MySQL database. The
problem is that I receive run-time errors with core dumped.
Here's my program:

using System;
using MySql.Data.MySqlClient;
namespace TestMono
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			const string ConnStr = "Server=localhost;Database=test;";
		        using (MySqlConnection conn = new MySqlConnection(ConnStr))
			using (MySqlCommand cmd = new MySqlCommand(
					"SELECT d.Name Department, e.Name Employee" +
					"FROM departments d INNER JOIN employees e ON d.DepartmentId =
e.DepartmentId "          
                                        + "WHERE e.FireDate IS NULL;",
					conn))
			{
				conn.Open();
				using (MySqlDataReader dr = cmd.ExecuteReader())
					while (dr.Read())
						Console.WriteLine(dr["Department"].ToString(), " - ",
dr["Employee"].ToString());
				conn.Close();
			}
		}
	}
}

Here's database structure:

Table 'employees':
| Field        | Type        | Null | Key | Default | Extra          |
| EmployeeId   | int(11)     | NO   | PRI | NULL    | auto_increment | 
| Name         | varchar(40) | NO   |     |         |                | 
| DepartmentId | int(11)     | NO   | MUL |         |                | 
| FireDate     | date        | YES  |     | NULL    |                | 
Table 'departments':
| Field        | Type        | Null | Key | Default | Extra          |
| DepartmentId | int(11)     | NO   | PRI | NULL    | auto_increment | 
| Name         | varchar(30) | NO   |     |         |                | 

Finally, here's output:

** (/home/robert/Projects/TestMono/TestMono/bin/Debug/TestMono.exe:6855):
WARNING **: The following assembly referenced from
/home/robert/Projects/TestMono/TestMono/bin/Debug/MySql.Data.dll could not
be loaded:
     Assembly:   System.Transactions    (assemblyref_index=4)
     Version:    2.0.0.0
     Public Key: b77a5c561934e089
The assembly was not found in the Global Assembly Cache, a path listed in
the MONO_PATH environment variable, or in the location of the executing
assembly (/home/robert/Projects/TestMono/TestMono/bin/Debug).
** (/home/robert/Projects/TestMono/TestMono/bin/Debug/TestMono.exe:6855):
WARNING **: Could not load file or assembly 'System.Transactions,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of
its dependencies.
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Stacktrace:
Native stacktrace:
	mono(mono_handle_native_sigsegv+0xde) [0x815644e]
	mono [0x8122c88]
	[0xffffe440]
	mono [0x8096ffe]
	mono(mono_class_vtable+0xc8) [0x80972a8]
	mono [0x8127c50]
	mono [0x813e6d0]
	mono [0x8140f06]
	mono [0x8142791]
	mono [0x8142c2b]
	mono(mono_runtime_exec_main+0x62) [0x80996b2]
	mono(mono_runtime_run_main+0x1b9) [0x8099999]
	mono(mono_main+0xe47) [0x805d477]
	mono [0x805c122]
	/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7d958cc]
	mono [0x805c071]
Aborted (core dumped)

I have copied MySql.Data.dll to GAC and I added reference to copy of
MySql.Data.dll in the project. I don't understand the problem of
System.Transactions because I had no problems with setup of Mono.
Could you help me please? 
Thank you!
/RAM/
-- 
View this message in context: http://www.nabble.com/newbie%3A-run-time-errors-with-core-dumped-in-console-app-tf4475608.html#a12761300
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list