Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/libraries/System.Data.OleDb/ref/System.Data.OleDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace System.Data.OleDb
{
[System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.Data.VS.OleDbCommandDesigner, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.ToolboxItemAttribute(true)]
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbCommand : System.Data.Common.DbCommand, System.Data.IDbCommand, System.ICloneable, System.IDisposable
{
public OleDbCommand() { }
Expand Down Expand Up @@ -120,13 +123,19 @@ public override void EnlistTransaction(System.Transactions.Transaction? transact
public override System.Data.DataTable GetSchema(string collectionName) { throw null; }
public override System.Data.DataTable GetSchema(string collectionName, string?[]? restrictionValues) { throw null; }
public override void Open() { }
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public static void ReleaseObjectPool() { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public void ResetState() { }
object System.ICloneable.Clone() { throw null; }
}
[System.ComponentModel.DefaultPropertyAttribute("Provider")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
{
public OleDbConnectionStringBuilder() { }
Expand All @@ -151,6 +160,9 @@ public override void Clear() { }
}
[System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterDesigner, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.ToolboxItemAttribute("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterToolboxItem, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbDataAdapter : System.Data.Common.DbDataAdapter, System.Data.IDataAdapter, System.Data.IDbDataAdapter, System.ICloneable
{
public OleDbDataAdapter() { }
Expand Down Expand Up @@ -183,6 +195,9 @@ protected override void OnRowUpdated(System.Data.Common.RowUpdatedEventArgs valu
protected override void OnRowUpdating(System.Data.Common.RowUpdatingEventArgs value) { }
object System.ICloneable.Clone() { throw null; }
}
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbDataReader : System.Data.Common.DbDataReader
{
internal OleDbDataReader() { }
Expand Down Expand Up @@ -229,6 +244,9 @@ public override void Close() { }
public sealed partial class OleDbEnumerator
{
public OleDbEnumerator() { }
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public System.Data.DataTable GetElements() { throw null; }
public static System.Data.OleDb.OleDbDataReader GetEnumerator(System.Type type) { throw null; }
public static System.Data.OleDb.OleDbDataReader GetRootEnumerator() { throw null; }
Expand Down Expand Up @@ -265,6 +283,9 @@ internal OleDbException() { }
#endif
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
}
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbFactory : System.Data.Common.DbProviderFactory
{
internal OleDbFactory() { }
Expand Down Expand Up @@ -477,6 +498,9 @@ public sealed partial class OleDbSchemaGuid
public static readonly System.Guid View_Table_Usage;
public OleDbSchemaGuid() { }
}
#if NET
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("OleDbConnection requires dynamic code.")]
#endif
public sealed partial class OleDbTransaction : System.Data.Common.DbTransaction
{
internal OleDbTransaction() { }
Expand Down
108 changes: 108 additions & 0 deletions src/libraries/System.Data.OleDb/src/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,112 @@
<Left>lib/netstandard2.0/System.Data.OleDb.dll</Left>
<Right>lib/net462/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbCommand:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataAdapter:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataReader:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbCommand:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataAdapter:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataReader:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbCommand:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataAdapter:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0015</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbDataReader:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetEnumerator(System.Type):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetRootEnumerator:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbConnection:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net10.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net10.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetEnumerator(System.Type):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetRootEnumerator:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbConnection:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net8.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net8.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetEnumerator(System.Type):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>M:System.Data.OleDb.OleDbEnumerator.GetRootEnumerator:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0016</DiagnosticId>
<Target>T:System.Data.OleDb.OleDbConnection:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
<Left>ref/net9.0/System.Data.OleDb.dll</Left>
<Right>runtimes/win/lib/net9.0/System.Data.OleDb.dll</Right>
</Suppression>
</Suppressions>
1 change: 1 addition & 0 deletions src/libraries/System.Data.OleDb/src/OleDbCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace System.Data.OleDb
{
[Designer("Microsoft.VSDesigner.Data.VS.OleDbCommandDesigner, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItem(true)]
[RequiresDynamicCode("OleDbConnection requires dynamic code")]
public sealed class OleDbCommand : DbCommand, ICloneable, IDbCommand
{
// command data
Expand Down
4 changes: 4 additions & 0 deletions src/libraries/System.Data.OleDb/src/OleDbConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ namespace System.Data.OleDb
// it won't happen if you directly create the provider and set its properties
// 2. First call on IDBInitialize must be Initialize, can't QI for any other interfaces before that
[DefaultEvent("InfoMessage")]
[RequiresDynamicCode(OleDbConnection.TrimWarning)]
public sealed partial class OleDbConnection : DbConnection, ICloneable, IDbConnection
{
internal const string TrimWarning = "OleDbConnection requires dynamic code.";

private static readonly object EventInfoMessage = new object();

public OleDbConnection(string? connectionString) : this()
Expand Down Expand Up @@ -636,6 +639,7 @@ internal bool SupportSchemaRowset(Guid schema)
}

// @devnote: should be multithread safe
[RequiresDynamicCode(OleDbConnection.TrimWarning)]
public static void ReleaseObjectPool()
{
OleDbConnectionString.ReleaseObjectPool();
Expand Down
4 changes: 4 additions & 0 deletions src/libraries/System.Data.OleDb/src/OleDbConnectionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
using System.Data.Common;
using System.Data.ProviderBase;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.Versioning;

namespace System.Data.OleDb
{
[RequiresDynamicCode("XML deserialization requires dynamic code")]
internal sealed class OleDbConnectionFactory : DbConnectionFactory
{
private OleDbConnectionFactory() : base() { }
Expand Down Expand Up @@ -44,6 +46,8 @@ protected override DbConnectionOptions CreateConnectionOptions(string connection
return result;
}

[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("Trimming", "IL3050:RequiresDynamicCode",
Justification = "OLE DB provider creates metadata factory with known schema.")]
protected override DbMetaDataFactory CreateMetaDataFactory(DbConnectionInternal internalConnection, out bool cacheMetaDataFactory)
{
Debug.Assert(internalConnection != null, "internalConnection may not be null.");
Expand Down
Loading