I'm trying to do a code-first "add-migration" but I am getting the 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 understand how to load the spatial DLL in the running app, but how do I do it when running a migration from the package manager?
Edit: OK, it's worse than I throught. This simple console app won't run because of the same error. I have Microsoft.SqlServer.Types installed from NuGet. Whats going on?
static void Main(string[] args)
{
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
System.Data.Entity.Spatial.DbGeography location = System.Data.Entity.Spatial.DbGeography.PointFromText("POINT(" + 10 + " " + 10 + ")", 4326);
}
Exception: Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found.