Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from System.Data.SqlClient to Microsoft.Data.SqlClient #23795

Open
cheenamalhotra opened this issue May 13, 2024 · 3 comments
Open

Update from System.Data.SqlClient to Microsoft.Data.SqlClient #23795

cheenamalhotra opened this issue May 13, 2024 · 3 comments
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. WG-DevEx-SDK hosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules

Comments

@cheenamalhotra
Copy link

cheenamalhotra commented May 13, 2024

Summary of the new feature / enhancement

It seems PowerShell SDK continues to be dependent on System.Data.SqlClient, which is obsolete and is not recommended by the driver community since many years now.

Ref: https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/

Microsoft.Data.SqlClient is the new driver library that must be used instead.
Use Porting Cheat Sheet to port application.

Could you elaborate why that migration hasn't been made in PowerShell SDK yet or if this is planned in near future?

Proposed technical implementation details (optional)

No response

@cheenamalhotra cheenamalhotra added Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels May 13, 2024
@iSazonov
Copy link
Collaborator

iSazonov commented May 14, 2024

See #16156 (comment)

@SteveL-MSFT What WG could make a conclusion about the Travis's comment?

@rhubarb-geek-nz
Copy link

I have done some investigation and packaging the new Microsoft.Data.SqlClient in PowerShell itself is problematic.

It contains a large number of dlls that simply aren't needed if you are not using it, and also includes its own copy of Azure.Core.dll and Azure.Identity.dll. These have potential to conflict with other modules and deployments.

A far better solution is to leave it to PSGallery and load the dlls in an AssemblyLoadContext.

I have a proof of concept on github and PSGallery

@SteveL-MSFT SteveL-MSFT added the WG-DevEx-SDK hosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules label May 20, 2024
@SteveL-MSFT
Copy link
Member

@daxian-dbw do you know why the SDK is dependent on this assembly? Looking in the source, I don't see any actual usage of it unless something else PowerShell depends on is depending on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. WG-DevEx-SDK hosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules
Projects
None yet
Development

No branches or pull requests

4 participants