I am using Visual Studio Code and trying to write a script for GTA 5 RAGEMP using C#, im fairly new to C# and it was all going good untill i tried to create MySQL connector using MySQL.Data from oracle. On my try - catch i get this:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.'
String SQLConnection = $"SERVER={sql.Host};PASSWORD={sql.Password};UID={sql.Username};DATABASE={sql.Database}";
conn = new MySqlConnection(SQLConnection);
try
{
conn.Open();
NAPI.Util.ConsoleOutput("MySQL connection is up!");
IsConnectionSetUp = true;
}
catch(Exception ex)
{
NAPI.Util.ConsoleOutput(ex.ToString());
}
I get this in server console output:
Could not load file or assembly 'System.Security.Permissions, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
And this in VSC console output:
Exception thrown: 'System.IO.FileNotFoundException' in MySql.Data.dll
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
An exception of type 'System.IO.FileNotFoundException' occurred in System.Private.CoreLib.dll but was not handled in user code
Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
I copied everything from MySQL/Connector to my runtime folder, i tried using NuGet to download System.Drawing.Common and System.Security.Permissions, i tried adding .DLLs manually to project dependecies, nothing worked.