microsoft / microsoft/sqlmanagementobjects

Microsoft.Data.SqlClient is not supported on this platform

オープン
#149 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
143
フォーク
28
PR マージ指標
30日以内にマージされた PR はありません

説明

I've searched this repository along with the sqlclient repository. There are multiple issues bring this up but are either closed or solutions provided don't seem to fix the issue I'm getting.

I'm trying to create a basic binary module in PowerShell against SQL Server. I have a basic project structure with just one cmdlet so far (trying to see if this even works) that references SMO library.

Project: https://github.com/wsmelton/dbalight/tree/modulebuilder/source/dbalight

The project compiles for dotnet 6 on my M1 and the module imports with no issues. It is not until I call the Connect-DblServer:

Exception             : 
    Type       : System.PlatformNotSupportedException
    TargetSite : Void .ctor()
    Message    : Microsoft.Data.SqlClient is not supported on this platform.
    Source     : Microsoft.Data.SqlClient
    HResult    : -2146233031
    StackTrace : 
   at Microsoft.Data.SqlClient.SqlConnection..ctor()
   at Microsoft.SqlServer.Management.Common.ConnectionManager..ctor(IRenewableToken token, Boolean removeIntegratedSecurity)
   at Microsoft.SqlServer.Management.Common.ConnectionManager..ctor()
   at Microsoft.SqlServer.Management.Common.ServerConnection..ctor()
   at dbalight.cmdlets.general.ConnectServerCmdlet.ProcessRecord() in 
/Users/smelton/git/dbalight/source/dbalight/cmdlets/public/ConnectServer.cs:line 41
   at System.Management.Automation.Cmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : NotSpecified: (:) [Connect-DblServer], PlatformNotSupportedException
FullyQualifiedErrorId : System.PlatformNotSupportedException,dbalight.cmdlets.general.ConnectServerCmdlet
InvocationInfo        : 
    MyCommand        : Connect-DblDblServer
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 26
    Line             : Connect-DblServer -ServerInstance 'localhost,1432' -Verbose
    PositionMessage  : At line:1 char:1
                       + Connect-DblServer -ServerInstance 'localhost,1432' -Verbose
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Connect-DblServer
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Line 41 of that cs file for the cmdlet is: ServerConnection srvCn = new ServerConnection();

  • Is there something in my csproj that I have configured wrong?
  • Is this just broken and I need to revert to an older version of the SQLManagementObjects library?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ServerConnection が構築される source/dbalight/cmdlets/public/ConnectServer.cs の 41 行目から開始し、リンクされている dbalight モジュールプロジェクトとその .csproj を調査します。報告された M1 および .NET 6 のセットアップで失敗を再現し、その後、プロジェクト構成または SQLManagementObjects のバージョンが Microsoft.Data.SqlClient のプラットフォーム例外を引き起こしているかどうかを特定します。検証済みの解決策または文書化された非互換性が得られれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, powershell, sql
領域
databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。