Bug #112119 Character set 'utf8mb3' is not supported by .Net Framework
Submitted: 21 Aug 2023 6:25 Modified: 21 Aug 2023 12:39
Reporter: Baris Samed Halici Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:10.6.9-MariaDB OS:Any
Assigned to: CPU Architecture:Any
Tags: character set, collation, Connector .NET, Connector .NET ADO.Net, utf8mb3

[21 Aug 2023 6:25] Baris Samed Halici
Description:
I'm going to start an ASP.NET Web Application project that uses the MySql database. I also need to create an ADO.NET Entity Data Model.

I know I need to install "MySql for Visual Studio Tool" and "MySql Connector/NET".

+ I have installed VS2017 Community.
+ I installed MySql Connector/NET 8.0.28 .. 8.0.33
+ I have installed MySql for Visual Studio Tool 1.2.10.

I can share the database connection information that I will connect to via message. I also write the database properties below. I couldn't find which versions would work in harmony. Can you try this on your own machine and let me know after you make sure it works?

MySql Database information:

+ Server: localhost via TCP/IP
+ Server type: MariaDB
+ Server connection: SSL is not being used Documentation
+ Server version: 10.6.9-MariaDB - mariadb.org binary distribution
+ Protocol version: 10
+ Server charset: UTF-8 Unicode (utf8mb4)

The result of the query show variables like '%char%' :

character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: utf8mb4
character_set_filesystem: binary
character_set_results: utf8mb4
character_set_server: utf8mb4
character_set_system: utf8mb3
character_sets_dir: C:\Program Files\MariaDB 10.6\share\charsets\

I created a video recording for you. You can check out my actions here.
https://www.veed.io/view/361a18d3-67f4-4420-8642-a9809d92a937?panel=share

The main cause of the error is the character set.
There was no such problem in version 10.3.X-MariaDB. Such a problem occurred after switching to utf8mb3 character set.
Character set 'utf8mb3' is not supported by .Net Framework.

How to repeat:

Open visual studio and create a project (C#, desktop, WPF).
Open the server explorer
Create a new data connection
Enter the server name "localhost"
Set the user name / password as appropriate
Test connection (should work)
Use the database name dropdown Note error:
 > Dialog MySql for visual studio, unable to retrieve the list of databases.
Advanced settings > Character Set = utf8mb3
 > Character set 'utf8mb3' is not supported by .Net Framework
[21 Aug 2023 9:19] Frederic Descamps
Hello,

MySQL for Visual Studio Tool 1.2.10 uses an embedded version of the driver. And old one that does not support that character set it seems.

I don't have a Windows environment to test, but it seems other people are having the same issue: see #107259

It seems that you could replace 3 files in C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\PrivateAssemblie with those from the latest connector (8.1.0):

- MySql.Data.dll
- MySql.Data.EntityFramework.dll
- MySql.Web.dll

You can find them in the mysql-connector-net-8.1.0.

I am not able test that workaround, but if you do, please comment.

Additionally, I would just like to inform you that there is no extra guarantee that our connector will work anyway with our Database Server. MariaDB is not a drop-in replacement for MySQL anymore. Both projects have diverged and are not compatible.

Regards,
[21 Aug 2023 12:39] MySQL Verification Team
Hello!

Thank you for the bug report.
Imho this is duplicate of Bug #107259, please see Bug #107259.
Also, test the workaround suggested by Frederic Descamps.

Regards,
Ashwini Patil
[21 Aug 2023 15:30] Pablo Mazza
Hello,

The workaround suggested by Deschamps simply breaks the designer. It closes without error.

Is it that difficult to ship a new version of the .net for Visual Studio?