I Have a problem. I\'m not able to add a Migration to my ASP.NET WebAPI 2 Project. I get error:
\"Spatial types and functions are not available for t
After a lot of research I just installed "Microsoft System CLR Types for SQL Server 2012" from:
Worked like a charm!
the problem may be "virtual". You need to have SqlServerSpatial140.dll in bin folder at the moment you issue add-migration command. Just copy the .dll to bin for development purpose and replace manually the version (x86/x64) during deployment. Sql Server (2012+) already has the assembly installed.
Make sure you are not missing a binding redirect
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0-11.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
This worked for me.
Add this to the web.config > system.webServer >> runtime >> assemblyBinding node
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>