-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
area-AssemblyLoader-coreclruntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
System.Data.OleDb 8.0.1 throws PlatformNotSupportedException: Performance Counters are not supported on this platform when OleDbConnection is initialized inside a custom AssemblyLoadContext on .NET 8.0 Windows.
This is a regression from version 8.0.0, which works without any issues in the same scenario.
Reproduction Steps
- Create a custom
AssemblyLoadContextwithisCollectible: true - Load an assembly that uses
System.Data.OleDbinto the custom context - Instantiate
OleDbConnectionvia reflection from within the custom context - Exception is thrown during static initialization of
DbConnectionPoolCounters
See attached minimal reproduction project:
OleDbCustomContextDemo.zip
Expected behavior
OleDbConnection should initialize successfully in a custom AssemblyLoadContext, as it does in version 8.0.0.
Actual behavior
Exception is thrown:
System.PlatformNotSupportedException: Performance Counters are not supported on this platform.
at System.Diagnostics.CounterCreationData..ctor(String counterName, String counterHelp, PerformanceCounterType counterType)
at System.Data.ProviderBase.DbConnectionPoolCounters.CreationData..cctor()
Regression?
No response
Known Workarounds
Downgrade to System.Data.OleDb 8.0.0 - works perfectly.
Configuration
- Package: System.Data.OleDb 8.0.1
- Framework: net8.0-windows
- Runtime: .NET 8.0
- Platform: Windows x64
Other information
The issue specifically occurs in custom AssemblyLoadContext, not in the default context.
Metadata
Metadata
Assignees
Labels
area-AssemblyLoader-coreclruntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Type
Projects
Status
No status