Skip to content

Commit 2e4d1b6

Browse files
Fix | SQL auth method validation on debug (#2288)
1 parent 84720a7 commit 2e4d1b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionStringCommon.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ internal static string ColumnEncryptionSettingToString(SqlConnectionColumnEncryp
524524

525525
internal static bool IsValidAuthenticationTypeValue(SqlAuthenticationMethod value)
526526
{
527-
Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 10, "SqlAuthenticationMethod enum has changed, update needed");
527+
#if ADONET_CERT_AUTH && NETFRAMEWORK
528+
Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 12, "SqlAuthenticationMethod enum has changed, update needed");
529+
#else
530+
Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 11, "SqlAuthenticationMethod enum has changed, update needed");
531+
#endif
528532
return value == SqlAuthenticationMethod.SqlPassword
529533
|| value == SqlAuthenticationMethod.ActiveDirectoryPassword
530534
|| value == SqlAuthenticationMethod.ActiveDirectoryIntegrated

0 commit comments

Comments
 (0)