microsoft / microsoft/sqlmanagementobjects
Microsoft.Data.SqlClient is not supported on this platform
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 143
- Fork
- 28
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da source/dbalight/cmdlets/public/ConnectServer.cs alla riga 41, dove viene costruito ServerConnection, e ispeziona il progetto del modulo dbalight collegato e il relativo .csproj. Riproduci il problema sulla configurazione M1 e .NET 6 segnalata, quindi determina se la configurazione del progetto o la versione di SQLManagementObjects causa l’eccezione di piattaforma di Microsoft.Data.SqlClient; il lavoro è concluso quando è disponibile una risoluzione verificata o un’incompatibilità documentata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, powershell, sql
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100