Skip to content

Commit 740ae0d

Browse files
committed
Exclude unused method from .NET 4.5 builds.
1 parent 375f930 commit 740ae0d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ private async Task<PayloadData> SendEncryptedPasswordAsync(
690690
}
691691
#endif
692692

693+
#if !NET45
693694
private async Task<string> GetRsaPublicKeyAsync(string switchRequestName, ConnectionSettings cs, IOBehavior ioBehavior, CancellationToken cancellationToken)
694695
{
695696
if (cs.ServerRsaPublicKeyFile.Length != 0)
@@ -720,6 +721,7 @@ private async Task<string> GetRsaPublicKeyAsync(string switchRequestName, Connec
720721
Log.Error("Session{0} couldn't use AuthenticationMethod '{1}' because RSA key wasn't specified or couldn't be retrieved", m_logArguments);
721722
throw new MySqlException(MySqlErrorCode.UnableToConnectToHost, "Authentication method '{0}' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.".FormatInvariant(switchRequestName));
722723
}
724+
#endif
723725

724726
public async ValueTask<bool> TryPingAsync(IOBehavior ioBehavior, CancellationToken cancellationToken)
725727
{

0 commit comments

Comments
 (0)