I have a completely new server on which I installed the beta version of .NET 4.5. When I try to use spatial functions, I get a NotImplemented exception. This code ...
var x = DbGeography.PointFromText(string.Format("POINT({0} {1})", -45, 45), 4326);
Throws this exception ...
System.NotImplementedException: The method or operation is not implemented. at System.Data.Spatial.DefaultSpatialServices.GeographyPointFromText(String geographyText, Int32 spatialReferenceSystemId)
If I install the full version of VS.NET 11 Beta, then the code will work fine. Any ideas why? What is missing?
UPDATE FOR ANSWER
Thanks to Pavel. You must install the SQL CLR types. You can get version 2012 from this link:
CLR Types for Microsoft® System for Microsoft® SQL Server® 2012 http://www.microsoft.com/download/en/details.aspx?id=29065
OPINION
I really don't understand why the .NET platform is dependent on SQL Server. There is nothing special about these classes. I understand that this is probably a historical thing when the code was originally written by the SQL team and the .NET team wanted to reuse it. It is not clear that this is also a provider-based implementation. A better exception message would save a day's work.
source share