'Microsoft.SqlServer.Types' version 10 or higher could not be found on Azure

Thomas Bolander picture Thomas Bolander · Nov 1, 2012 · Viewed 58.2k times · Source

I'm trying to make a webapi in ASP.NET MVC 4. The webapi used Entity Framework 5 Spatial types and i have wrote a very simple code.

  public List<Area> GetAllAreas()
    {
        List<Area> aList = db.Areas.ToList();
        return aList;
    }

Area contains DbGeometry.

When i run this local it works, but when i publish it to azure it gives me this 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.

Anyone know how to resolve this ? :)

Thanks!

Answer

Thomas Bolander picture Thomas Bolander · Nov 1, 2012

I found the solution ! Just install the nuget package Microsoft.SqlServer.Types

PM> Install-Package Microsoft.SqlServer.Types

Link for more info