I have Update 3 for Visual Studio 2015 Community Edition. Entity Framework 6 is what I'm using. When I run the project locally, I see the error indicated in the screen photo (https://puu.sh/uXFh0/64648902af.png). As c.Geography is used in my code, it throws an error at that moment.
My computer is running SQL Server 2016 with CLR Types installed, as can be seen in the screen photo below (https://puu.sh/uXFqy/9f3c56a329.png).
Using the nuget package Install-Package Microsoft.SqlServer.Types, I also installed SQL server types.
I've had no success. What more can I do to address this situation?
You must instruct your programme which version of the CLR types to use since you have many versions installed. I'm unsure of the kind of application, but you must either add the following lines of code to your global.asax.cs (web app) file:
SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin")); SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=188.8.131.52, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
Alternatively, display this in your desktop app before the spatial code runs:
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory); SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=184.108.40.206, Culture=neutral, PublicKeyToken=89845dcd8080cc91";