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
For example, this compiles and runs fine:
Compiles and runs fine with:
However, when I compile ServUO, i.e.
It compiles without errors, but when it gets to my script, it get this:
Any help would be appreciated. thanks and Happy New Year!
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();
}
}
}
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
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!