Spatial types and functions are not available for this provider because the assembly ‘Microsoft.SqlServer.Types’ version 10 or higher could not be found

Posted · Add Comment

Entity Code First supports SQL spatial types but in a new project, like me with VS 2015, I got an 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

When developing your application the CLR Types for SQL Server are usually installed system-wide, since they are included in Visual Studio. Issues arrived when you try to deploy to a machine that does not have the CLR Types for SQL Server installed or a new dev machine. I currently run a freshly installed Windows 10 and Visual Studio 2015 Enterprise.

The solution

Solution 1: Install the Microsoft.SqlServer.Types NuGet package.

Solution 2: Install SQL Server on your dev machine with the CLR Types.

Hope this helps !

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

 
DMS