Skip to content

System.Data.SqlClient throwing System.PlatformNotSupportedException when loaded via reflection #23639

@softeering

Description

@softeering

System.Data.SqlClient does not work when loading the external library (.NET Standard DLL) at runtime through reflection except if the library has been published for a specific platform (rid).
Trying to execute a SQL query against a SQL Server instance throws "System.PlatformNotSupportedException: System.Data.SqlClient is not supported on this platform" exception.

Repro steps and Visual studio solution can be found here:
https://github.com/softeering/NETStandardSQLClientRepro

I'm pretty sure this can be explained but I don't get why it doesn't work

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.RuntimequestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions