I have a brand new server which I installed the .NET 4.5 Beta redistributable on. I am getting a NotImplemented exception when trying to use the spatial features. 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 VS.NET 11 Beta then the code works fine. Any ideas why? What is missing?
UPDATE FOR ANSWER
Thanks to Pawel. You need to have the SQL CLR Types installed. You can get the 2012 version at this link:
Microsoft® System CLR Types for Microsoft® SQL Server® 2012 http://www.microsoft.com/download/en/details.aspx?id=29065
OPINION
I really dont understand why the .NET framework has a dependency on SQL Server. There is nothing special about these classes. I realize this is likely a historical thing where the code was originally written by the SQL team and the .NET team wanted to reuse it. It's not very clear that this is a provider-based implementation either. A better exception message would have saved a day's work.