These are my troubleshooting steps to fix the problem.
- Install IISCrypto.exe, and turn off TSL 1.0/1.1 on my local server and client, only leave TSL 1.2 enabled.
- In my .NET app web.conf
<system.web>
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8" />
- Tools > NuGet Package Manager > Manage NuGet Package for Solution.
Check the installed version of MySql.Data and MySql.Web (was 6.9.9.0)
Install and update MySql.Data and MySql.Web to Version 8.0.23
At this point, my local .NETweb server can talk to local MySql server. But after deployed to the production server (where only TLS 1.2 is enabled), a different error message shows up.
Fail to load MySql.Data assembly
WRN: Assembly binding logging is turned OFF.
Check the MySql.Web.dll & MySql.Data.dll under the production server ...\myapp\bin
Find that MySql.Data.dll is still in version 6.9.
Copy and paste MySql.Data.dll v.8.0.23 to the production server (from my local bin folder). And it fixes the problem on the production server.