I have Visual studio 2015 community Edition with Update 3. I am using Entity Framework 6. On running the project on my local I am getting the error as shown in screen shot(https://puu.sh/uXFh0/64648902af.png). As in the code I am using c.Geography; its showing exception at that point.
I have Sql Server 2016 installed on my system with CLR Types as shown in below screen shot https://puu.sh/uXFqy/9f3c56a329.png
I also installed Sql server types using nuget package Install-Package Microsoft.SqlServer.Types.
Still no luck. what else can I do to solve the issue?
You have multiple versions of the CLR types installed so you need to tell your application which version to use. Not sure what type of application it is but you need to either put these lines of code in your global.asax.cs (web app):
SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin")); SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=126.96.36.199, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
or else this in your desktop app prior to the spatial code running:
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory); SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=188.8.131.52, Culture=neutral, PublicKeyToken=89845dcd8080cc91";