Ixtabay

Member
I'm having some trouble compiling a ServUO.MONO.exe that includes MySql.Data.dll

I can create other .cs files and compile without issues with -r:MySqlData.dll, and when I add this, ServUO compiles fine, but I get errors when it loads my custom scripts with

Code:
using MySql.Data;
using MySql.Data.MySqlClient;

For example, this compiles and runs fine:

Code:
using System;
using System.Data;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace Test.MySqlTest
{
	class MySqlTest
	{
		[STAThread]
		static void Main(string[] args)
		{
			MySqlConnection dbcon = new MySqlConnection();
			dbcon.ConnectionString = "SERVER=myserver;PORT=3306;UID=myrunuo;PASSWORD=mypassword;DATABASE=myrunuo";

			dbcon.Open();

			MySqlCommand dbcmd = new MySqlCommand();
			dbcmd.Connection = dbcon;
			dbcmd.CommandType = CommandType.Text;
			dbcmd.CommandText = "SELECT * FROM myrunuo_characters";

			MySqlDataReader reader;
			reader = (MySqlDataReader) dbcmd.ExecuteReader();

			while(reader.Read()) {
				Console.WriteLine("id: " + reader[0].ToString());
			}
			reader.Close();
			dbcmd.Dispose();
			dbcon.Close();
		}
	}
}
Compiles and runs fine with:
Code:
mcs -out:test.exe -r:MySql.Data.dll,System.Data.dll ./test.cs

mono test.exe

However, when I compile ServUO, i.e.
Code:
${MCS} -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS},MySql.Data.dll -target:exe -out:${CURPATH}/ServUO.MONO.exe -d:ServUO -d:NEWTIMERS -d:MONO -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs
It compiles without errors, but when it gets to my script, it get this:

Code:
ServUO - [http://www.servuo.com] Version 0.5, Build 6210.13512
Publish
Core: Optimizing for 1 64-bit processor
Core: Unix environment detected
RandomImpl: SimpleRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ _Custom/MySQL_Stuff/DatabaseCommands.cs:
    CS0246: Line 5: The type or namespace name `MySql' could not be found. Are you missing an assembly reference?
    CS0246: Line 6: The type or namespace name `MySql' could not be found. Are you missing an assembly reference?
Scripts: One or more scripts failed to compile or no script files were found.

Any help would be appreciated. thanks and Happy New Year!
 
add ${CURPATH}/ infront of the mysql.dll

Didn't work. Here is what I've tried:
  • Added the package: sudo gacutil /i /package 4.5 MySql.Data.dll
  • Copying the MySql.Data.dll to the same directory
  • Using full path (i.e. /usr/lib/mono/gac/MySql.Data/6.9.9.0__c5687fc88969c44d/MySql.Data.dll )
  • Updated machine.config for 4.0 and 4.5
The crazy thing is that is that both 4.0 and 4.5 work fine when compiling other .cs
 
I did find a workaround. If I move it into the server folder and compile with the server it works fine.
 

Active Shards

Donations

Total amount
$80.00
Goal
$1,000.00
Back