Future of Microsoft.SqlServer.Types in .NET Core or .NET 6

Justin Martinek 21 Reputation points
2021-11-23T16:11:43.943+00:00

Greetings,

Attempting to move beyond Microsoft.SqlServer.Types full framework to a more scalable solution using .NET Core has proven to be difficult. Net Topology Suite does not use geography outright but supports geography by projecting into a defined coordinate system using transforms and then doing work on it with geometry operations.

dotMorten has created a Microsoft.SqlServer.Types lib on GitHub, but that is limited in that you have to define the more complicated spatial operations yourself, hoping that they align with the old defined operations in Microsoft.SqlServer.Types/SqlServerSpatial assemblies.

Has there been any effort or discussion to redo the old Microsoft.SqlServer.Types binaries for use in .NET Core or even .NET 6?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,682 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ben Roth 6 Reputation points
    2022-05-02T23:53:52.37+00:00

    There is currently an open issue about this here: https://github.com/dotnet/SqlClient/issues/30 The old assemblies can still be used in .NET Core, but only on windows machines, and with other limitations. (details are available in comments on the issue).

    However since there's been no substantive movement in the 3 years since this issue was opened, if you're unable to use the existing native assemblies then your best bet is probably to output the data to a 3rd party nuget that has the functionality you need. https://github.com/DotSpatial/DotSpatial and https://github.com/GeoJSON-Net/GeoJSON.Net are both referenced in the SqlClient Issue, with GeoJSON.NET apparently being able to import and export while converting with geography.STAsBinary() on the sql server side.

    1 person found this answer helpful.
    0 comments No comments

  2. Tom Phillips 17,716 Reputation points
    2021-11-23T16:57:49.053+00:00

    Your question is about .Net Core. The .Net Core forums are here https://learn.microsoft.com/en-us/answers/products/dotnet?WT.mc_id=dotnet-35129-website

    0 comments No comments

  3. Michael Taylor 47,806 Reputation points
    2021-11-23T18:12:37.903+00:00

    Discussions around spatial types in .NET 5+ are handled on the new Microsoft.Data.SqlClient repo. They are building out the next generation tools for SQL in .NET 5+. There is already a discussion about spatial types here that you can join in on to see where they are going with it.

    Microsoft.SqlServer.Types is actually part of SQL Server and not .NET. I would not consider it a future-focused assembly to work with. You should probably consider switching to Microsoft.Data.SqlClient if at all possible.