SqlClient: Collation is not supported for Traditional_Spanish_CI_AS

Describe the bug

I´m trying to map an entire database with Traditional_Spanish_CI_AS collation with Entity Framework Core 6 with .net6.

When I try to execute the command for scaffold the database drops this error:

Exception message:
Stack trace:

image

SQL Server 2019 .net 6 Visual Studio 2022 EF Core 6

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (13 by maintainers)

Most upvoted comments

It’s possible, though the exception stack trace above seems to indicate that the exception happens during reverse engineering, rather than afterwards… It looks like EF Core is being asked to reverse engineer, but then SqlClient is throwing that error while reading reverse engineering results from the database. It might specifically be a column name on some table that uses the unsupported collation, triggering the exception when we try to read that column name in GetTables.

Re 6 vs. 5, it seems like this is a .NET 6 vs. 5 issue (dotnet/runtime#61977) rather than an EF Core 6 vs. EF Core 5; @mobius127 can you confirm this? Can you scaffold when running EF Core 5 on .NET 6.0?

@mobius127 what exact exception are you seeing when trying to use Microsoft.EntityFrameworkCore.SqlServer 6.0.0 with Microsoft.Data.SqlClient 4.0.0? I’ve just done a quick test application and it works fine for me - can you post a sample app which fails etc?