Error after compiling WebGL (695552)

After compiling the project under WebGL, I open the project in the browser. After loading the project in the window, everything that is displayed is a black screen. Then, after a while, a window with the error text is displayed:

The application uses a connection to the database, I assume that it is because of this that there are errors. I do the connection to the database in the following way:

string serverName = "192.168.1.3";
         string userName = "name";
         string dbName = "BaseData";
         string port = "3306";
         string password = "password";
         string connStr = "server=" + serverName +
             ";user=" + userName +
             ";database=" + dbName +
             ";port=" + port +
             ";password=" + password + ";";
         MySqlConnection conn = new MySqlConnection(connStr);
         conn.Open();                                          
         string sql = "SELECT e.id id, c1.x x1, c1.y y1, c1.z z1, c2.x x2, c2.y y2, c2.z z2, p.title " +
             "FROM edge e JOIN place p ON e.place_id = p.id JOIN conjunction c1 ON e.conjunction_start_id = " +
             "c1.id JOIN conjunction c2 ON e.conjunction_end_id = c2.id WHERE `e`.`id` < 940000";
         MySqlCommand command = new MySqlCommand(sql, conn);
         reader = command.ExecuteReader();

Tell me, maybe I’m doing something wrong, or someone, perhaps, faced such a problem?

P.S. In the Unity editor, everything works.

It might be worth making a development build with full exception support enabled. We should get more details about the cause of the issue from that.

In addition, some of the code might be stripped. Is MySqlConnectionStringBuilder in its own DLL? We do strip DLLs, but don’t strip the code which is compiled from C# code in the project.

I correctly understand that it is necessary to tick the box next to the "Development Build" field? If yes, then this error appears with this assembly.

This library was downloaded from the official site. Then I put it in the "Libraries" folder and everything in the unity editor started working. By the way, if I compile the project in .exe, then the connection to the database occurs without errors and everything works.

3438688--271976--download.png
You need this setting.

“Libraries” folder

What folder do you mean?

As I understand the library is in a form of a DLL, so some classes from it might be stripped by Unity and this results in the error you see. Desktop builds are not stripped.

Now my project has stopped compiling at all and produces errors:

Tell me, do I need to choose .net 2.0 or .net 2.0 subset?

Just the folder that I create in “Assets”.

We managed to solve the problem! I dropped the connection to the database and use a controller written in php. I connect to the controller using a plugin that is written in js using an ajax-request. Then, after I get the data from the js plugin in с# I deserialize the data. After that I have full access to my data in the project unity. The main thing is that all this works in WebGL.

P.S. If someone has encountered a similar problem and does not know how to solve it, then write to me: dimosyav10@gmail.com or skype: KonkypenT-142. I will try to help you with this.