microsoft / microsoft/sqlmanagementobjects
Microsoft.Data.SqlClient is not supported on this platform
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 143
- Fork
- 28
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với source/dbalight/cmdlets/public/ConnectServer.cs tại dòng 41, nơi ServerConnection được khởi tạo, và kiểm tra project module dbalight được liên kết cùng .csproj của nó. Tái hiện lỗi trên thiết lập M1 và .NET 6 đã được báo cáo, sau đó xác định liệu cấu hình project hay phiên bản SQLManagementObjects gây ra ngoại lệ nền tảng của Microsoft.Data.SqlClient; hoàn tất khi có một cách giải quyết đã được xác minh hoặc một tình trạng không tương thích được ghi nhận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, powershell, sql
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100