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

Microsoft.Data.SqlClient is not supported on this platform with .NET9 class library and winforms app #3006

Open
heckradr opened this issue Nov 15, 2024 · 0 comments
Labels
🆕 Triage Needed For new issues, not triaged yet.

Comments

@heckradr
Copy link

Microsoft.Data.SqlClient is not supported on this platform

On a windows 11 pc with the latest Visual Studio 2022 (17.13.0, preview 1) I get an exception "Microsoft.Data.SqlClient is not supported on this platform" when using EF Core in an DLL project which is referenced by another project (for example a winforms project).

I'm using EF-Core 9 with .NET 9 (but encountered the same problem with .NET8).

I saw other issues with this exception in combination with .NET Standard (#2840) or .NET Framework (#2786), but in my case there are only .NET8/9 projects involved.

You can solve the problem by including the Microsoft.Data.SqlClient NuGet package directly in the WinForms project. However, I see this as just a workaround; it should actually work without this direct reference.

Exception message:
Microsoft.Data.SqlClient is not supported on this platform

Reproduce / test repo

I created a test repo to show this problem: https://github.com/heckradr/SQL-Client-Problems

Further technical details

Microsoft.Data.SqlClient version: 5.16.24240.5 (but same problem with 5.22.24240.6)
.NET target: .NET9
SQL Server version: SQL Server 2022
Operating system: Windows 11 23H2 (22631.4460)

@cheenamalhotra cheenamalhotra added the 🆕 Triage Needed For new issues, not triaged yet. label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 Triage Needed For new issues, not triaged yet.
Projects
None yet
Development

No branches or pull requests

2 participants