background:
If you want to use C# to connect mysql, please note that mysql is not a sqlserver, but you find that it cannot reference other corresponding dlls.
reason:
Official question: Only Oracle and SQLServer are supported after 2019, so it was downgraded to 2019, but it was found that it still did not.
There are all kinds of answers online, some say they want to install mysql for visualstodio, some say they want to install mysql for .net, but they are all useless.
Later, I accidentally found an alternative solution.
Solution:
In principle, as long as I can get the appropriate DLL, I found that I opened the Unity-related C# project and there were a complete DLL about MySQL connections in the reference, and I just copied it and then referenced Custom.
So pretend to be Unity and everything is OK.
Or if MySQL for net is installed, you can also use the followingManually add dlls to the path
:C:\Program Files (x86)\MySQL\MySQL Connector Net 8.0.27\Assemblies
Replenish
Finally, the root cause was that the NetframeWork version used when building the project was 3.5, which was too low, and you can see it in 4.7 and 4.8.
The above is a solution that is not available in Visual Studio 2022 that the editor introduced to you. I hope it will be helpful to you. Thank you very much for your support for my website!