The current approach, which works, but feels very ugly is doing like this (::0 is an invalid address which causes it to fail early and not to make an actual connection to localhost, which it would if no host is specified):
Code: Select all
try {
using (var dummy = new MySqlConnection(new MySqlConnectionStringBuilder {
Host = "::0", LicenseKey = "LICENSEKEY_GOES_HERE"}.ToString())) {
dummy.Open();
}
} catch { }