Skip to content

Commit 0743ea4

Browse files
committed
Suppress trimming warnings. Fixes #1607
1 parent c29087c commit 0743ea4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/MySqlConnector/MySqlConnectionStringBuilder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ namespace MySqlConnector;
1515
/// <see cref="MySqlConnectionStringBuilder"/> allows you to construct a MySQL connection string by setting properties on the builder then reading the <see cref="DbConnectionStringBuilder.ConnectionString"/> property.
1616
/// </summary>
1717
/// <remarks>See <a href="https://mysqlconnector.net/connection-options/">Connection String Options</a> for more documentation on the options.</remarks>
18+
#if NET6_0_OR_GREATER && !NET10_0_OR_GREATER
19+
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2113:ReflectionToRequiresUnreferencedCode", Justification = "Suppressing the same warnings as suppressed in the base DbConnectionStringBuilder.")]
20+
#endif
1821
public sealed class MySqlConnectionStringBuilder : DbConnectionStringBuilder
1922
{
2023
/// <summary>
@@ -873,6 +876,8 @@ internal string GetConnectionString(bool includePassword)
873876
/// <param name="propertyDescriptors">The collection of <see cref="PropertyDescriptor"/> objects to populate.</param>
874877
#if NET6_0_OR_GREATER
875878
[RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
879+
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:ReflectionToRequiresUnreferencedCode",
880+
Justification = "Suppressing the same warnings as suppressed in the base DbConnectionStringBuilder. See https://github.com/mysql-net/MySqlConnector/issues/1607")]
876881
#endif
877882
protected override void GetProperties(Hashtable propertyDescriptors)
878883
{

src/MySqlConnector/MySqlDataReader.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ internal async Task InitAsync(CommandListPosition commandListPosition, ICommandP
510510
}
511511
}
512512

513+
#if NET6_0_OR_GREATER
514+
[UnconditionalSuppressMessage("Trimming", "IL2111", Justification = "typeof(Type).TypeInitializer is not used.")]
515+
#endif
513516
internal DataTable? BuildSchemaTable()
514517
{
515518
if (!m_resultSet.HasResultSet || m_resultSet.ContainsCommandParameters)

0 commit comments

Comments
 (0)