-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
EntityFrameworkCore IndexOutOfRangeException when saving geometry using NetTopologySuite #18813
Comments
Note for triage: repros on 3.1; stack below. Looks like it could be a SqlClient/TDS issue. /cc @bricelam for spatial
|
cc @airbreather (In case you see additional reports of this issue) |
I also stumbled on this, it seems to happen when the geometry gets larger than a specific size:
|
I did a little bit of a binary search to try to get more details about this... on MSSQL 14.0.2027.2, it appears to happen when So a
|
@Wraith2 Could this be a limitation of dotnet/corefx#36678? Or something deeper... |
The parameter is being converted into bytes correctly but the byte array value is too long. That restriction was there before I made my change and I've no idea where it came from. The exception type isn't very good and it should really have a message that explains the problem instead of looking like an internal error in SqlClient. |
Filed dotnet/SqlClient#329 since the SqlClient limitation is causing the issue here. |
When I call
db.SaveChanges()
, on some geometries I get IndexOutOfRangeException.(Just posted this on S-O)
Steps to reproduce
Code snippet here:
https://gist.github.com/capesean/57527a0576d5972ff1514438440397fa
It works fine in SQL Server though:
Further technical details
EF Core version: 3.0.0
Database provider: SQL Server 2014
Target framework: .NET Core 3.0
Operating system: Win10
IDE: e.g. Visual Studio 2019 16.3.6
The text was updated successfully, but these errors were encountered: