Skip to content

"Microsoft.Data. SqlClient is not supported on this platform." when trying to use it in PowerShell 7.0.2 #623

@MasayukiOzawa

Description

@MasayukiOzawa

The following environments are used as PowerShell Core.

Name                           Value
----                           -----
PSVersion                      7.0.2
PSEdition                      Core
GitCommitId                    7.0.2
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Download 2.0.0.

Install-Package Microsoft.Data.SqlClient

Now, the following script will run Exception calling ".ctor" with "0" argument(s): "Microsoft.Data. SqlClient is not supported on this platform. It occurs.

$dllPath = Join-Path $ENV:USERPROFILE "\AppData\Local\PackageManagement\NuGet\Packages\Microsoft.Data.SqlClient.2.0.0\lib\netcoreapp2.1\Microsoft.Data.SqlClient.dll"
Add-Type -path $dllPath
$con = New-Object Microsoft.Data.SqlClient.SqlConnection

Can't I run Microsoft.Data. SqlClient 2.0.0 on PowerShell Core 7.0.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    External 🔗Issue is in an external component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions