Hello again,
I am having a problem when I try to add a DBGeography property in a Model class. When I try to create the migration I receive this error:
Spatial types and functions are not available for this provider because the assembly ‘Microsoft.SqlServer.Types’ version 10 or higher could not be found.
I installed the nuget v14 in both, EntityFramework and Core projects with the same result. Migration is not created.
I have been working with spatial types in other projects without ABP without this issue. How can I solve it? It is mandatory for my project to work with Spatial Types.
Thanks in advance.
12 Answer(s)
-
0
Hi @josus
Are you using EntityFramework Core or Entity Framework 6.x ?
-
0
6.x
-
0
I haven't tried but the article below might help you to solve this problem. Have you seen it before ?
https://www.andrewcbancroft.com/2017/03/27/solving-spatial-types-and-functions-are-not-available-with-entity-framework/
-
0
Yes, I tried, it works on projects without ABP but, I don't know why, it doesn't work on ABP projects. As I saw in my first question, I tried to install the nuget in all the projects, include the Test project!!! and the result is always the same. I am unable to generate the migration.
-
0
Hi,
there is a possibility of it caused by sql server installation came along with vs studio.
https://docs.microsoft.com/en-us/ef/ef6/fundamentals/providers/spatial-support#prerequisites-for-spatial-types-with-microsoft-sql-server
have you tried loading the assembly at runtime as mentioned in https://www.koskila.net/solving-the-spatial-types-and-functions-are-not-available-problem/ ?
-
0
Hi again,
I have SQL Server Developper edition installed on my dev machine. I also installed the SQLSysClrTypes.msi as described in the Microsoft page and the problem is still happening.
-
0
@josus,
Could you move the assembly loading code into the constructor of Configuration class in EntityFramework project ? I guess, Global.asax class is not runned when adding the migration.
-
0
I will try
-
0
Not working...
-
0
Hi @josus
Sorry for my late response. I have worked on this issue but couldn't manage to do it.
Have you figured out a solution ?
-
0
Not yet, I googled for any tip without results. Perhaps another customer has implemented something similar and can help us to solve it.
-
0
Hi @josus
I worked on this but couldn't succeed, sorry.